Interface CDSShardAccess
-
@Beta @Deprecated(forRemoval=true) public interface CDSShardAccess
Deprecated, for removal: This API element is subject to removal in a future version.Unprivileged access interface to shard information. Provides read-only access to operational details about a CDS shard.- Author:
- Robert Varga
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @NonNull LeaderLocation
getLeaderLocation()
Deprecated, for removal: This API element is subject to removal in a future version.Return the shard leader location relative to the local node.@NonNull DOMDataTreeIdentifier
getShardIdentifier()
Deprecated, for removal: This API element is subject to removal in a future version.Return the shard identifier.@NonNull CompletionStage<Void>
makeLeaderLocal()
Deprecated, for removal: This API element is subject to removal in a future version.Request the shard leader to be moved to the local node.<L extends LeaderLocationListener>
@NonNull LeaderLocationListenerRegistration<L>registerLeaderLocationListener(@NonNull L listener)
Deprecated, for removal: This API element is subject to removal in a future version.Register a listener to shard location changes.
-
-
-
Method Detail
-
getShardIdentifier
@NonNull DOMDataTreeIdentifier getShardIdentifier()
Deprecated, for removal: This API element is subject to removal in a future version.Return the shard identifier.- Returns:
- Shard identifier.
- Throws:
IllegalStateException
- if theCDSDataTreeProducer
from which the associatedCDSDataTreeProducer
is no longer valid.
-
getLeaderLocation
@NonNull LeaderLocation getLeaderLocation()
Deprecated, for removal: This API element is subject to removal in a future version.Return the shard leader location relative to the local node.- Returns:
- Shard leader location.
- Throws:
IllegalStateException
- if theCDSDataTreeProducer
from which the associatedCDSDataTreeProducer
is no longer valid.
-
makeLeaderLocal
@NonNull CompletionStage<Void> makeLeaderLocal()
Deprecated, for removal: This API element is subject to removal in a future version.Request the shard leader to be moved to the local node. The request will be evaluated against shard state and satisfied if leader movement is possible. If current shard policy or state prevents the movement from happening, the returnedCompletionStage
will report an exception.This is a one-time operation, which does not prevent further movement happening in future. Even if this request succeeds, there is no guarantee that the leader will remain local in face of failures, shutdown or any future movement requests from other nodes.
Note that due to asynchronous nature of CDS, the leader may no longer be local by the time the returned
CompletionStage
reports success.- Returns:
- A
CompletionStage
representing the request. - Throws:
IllegalStateException
- if theCDSDataTreeProducer
from which the associatedCDSDataTreeProducer
is no longer valid.
-
registerLeaderLocationListener
<L extends LeaderLocationListener> @NonNull LeaderLocationListenerRegistration<L> registerLeaderLocationListener(@NonNull L listener)
Deprecated, for removal: This API element is subject to removal in a future version.Register a listener to shard location changes. Each listener object can be registered at most once.- Parameters:
listener
- Listener object- Returns:
- A
LeaderLocationListenerRegistration
for the listener. - Throws:
IllegalArgumentException
- if the specified listener is already registered.IllegalStateException
- if theCDSDataTreeProducer
from which the associatedCDSDataTreeProducer
is no longer valid.NullPointerException
- if listener is null.
-
-