public class LocalClusterCoordinator extends ClusterCoordinator
| Modifier and Type | Class and Description |
|---|---|
class |
LocalClusterCoordinator.LocalSemaphore |
ClusterCoordinator.RegistrationHandlelisteners| Constructor and Description |
|---|
LocalClusterCoordinator() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Collection<CoordinationProtos.DrillbitEndpoint> |
getAvailableEndpoints()
Get a collection of available Drillbit endpoints, Thread-safe.
|
Collection<CoordinationProtos.DrillbitEndpoint> |
getOnlineEndPoints()
Get a collection of ONLINE Drillbit endpoints by excluding the drillbits
that are in QUIESCENT state (drillbits shutting down).
|
<V> TransientStore<V> |
getOrCreateTransientStore(TransientStoreConfig<V> config)
Returns a
store instance with the given configuration. |
DistributedSemaphore |
getSemaphore(String name,
int maximumLeases) |
ClusterCoordinator.RegistrationHandle |
register(CoordinationProtos.DrillbitEndpoint data) |
void |
start(long millis)
Start the cluster coordinator.
|
void |
unregister(ClusterCoordinator.RegistrationHandle handle) |
ClusterCoordinator.RegistrationHandle |
update(ClusterCoordinator.RegistrationHandle handle,
CoordinationProtos.DrillbitEndpoint.State state)
Update drillbit endpoint state.
|
addDrillbitStatusListener, drillbitRegistered, drillbitUnregistered, isDrillbitInState, removeDrillbitStatusListenerpublic void start(long millis)
throws Exception
ClusterCoordinatorstart in class ClusterCoordinatormillis - The maximum time to wait before throwing an exception if the
cluster coordination service has not successfully started. Use 0
to wait indefinitely.Exceptionpublic ClusterCoordinator.RegistrationHandle register(CoordinationProtos.DrillbitEndpoint data)
register in class ClusterCoordinatorpublic void unregister(ClusterCoordinator.RegistrationHandle handle)
unregister in class ClusterCoordinatorpublic ClusterCoordinator.RegistrationHandle update(ClusterCoordinator.RegistrationHandle handle, CoordinationProtos.DrillbitEndpoint.State state)
update in class ClusterCoordinatorpublic Collection<CoordinationProtos.DrillbitEndpoint> getAvailableEndpoints()
ClusterCoordinatorgetAvailableEndpoints in class ClusterCoordinatorpublic Collection<CoordinationProtos.DrillbitEndpoint> getOnlineEndPoints()
getOnlineEndPoints in class ClusterCoordinatorpublic DistributedSemaphore getSemaphore(String name, int maximumLeases)
getSemaphore in class ClusterCoordinatorpublic <V> TransientStore<V> getOrCreateTransientStore(TransientStoreConfig<V> config)
ClusterCoordinatorstore instance with the given configuration.
Note that implementor might cache the instance so new instance creation is not guaranteed.getOrCreateTransientStore in class ClusterCoordinatorV - value type for this storeconfig - store configurationCopyright © 2017 The Apache Software Foundation. All rights reserved.