@Beta
public interface CDSShardAccess
Modifier and Type | Method and Description |
---|---|
LeaderLocation |
getLeaderLocation()
Return the shard leader location relative to the local node.
|
org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier |
getShardIdentifier()
Return the shard identifier.
|
CompletionStage<Void> |
makeLeaderLocal()
Request the shard leader to be moved to the local node.
|
<L extends LeaderLocationListener> |
registerLeaderLocationListener(L listener)
Register a listener to shard location changes.
|
@Nonnull org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier getShardIdentifier()
IllegalStateException
- if the CDSDataTreeProducer
from which the associated
CDSDataTreeProducer
is no longer valid.@Nonnull LeaderLocation getLeaderLocation()
IllegalStateException
- if the CDSDataTreeProducer
from which the associated
CDSDataTreeProducer
is no longer valid.@Nonnull CompletionStage<Void> makeLeaderLocal()
CompletionStage
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.
CompletionStage
representing the request.IllegalStateException
- if the CDSDataTreeProducer
from which the associated
CDSDataTreeProducer
is no longer valid.@Nonnull <L extends LeaderLocationListener> LeaderLocationListenerRegistration<L> registerLeaderLocationListener(@Nonnull L listener)
listener
- Listener objectLeaderLocationListenerRegistration
for the listener.IllegalArgumentException
- if the specified listener is already registered.IllegalStateException
- if the CDSDataTreeProducer
from which the associated
CDSDataTreeProducer
is no longer valid.NullPointerException
- if listener is null.Copyright © 2019 OpenDaylight. All rights reserved.