public class ZKClusterCoordinator extends ClusterCoordinator
This is a clone of the Drill class org.apache.drill.exec.coord.zk.ZKClusterCoordinator with a number of modifications:
This class should be replaced by the Drill version if/when the Guava conflicts can be resolved (and when registered Drillbit notifications are added to the Drill version.)
ClusterCoordinator.RegistrationHandle| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
listeners| Constructor and Description |
|---|
ZKClusterCoordinator(String connect,
String zkRoot,
String clusterId,
int retryCount,
int retryDelayMs,
int connectTimeoutMs) |
addDrillbitStatusListener, drillbitRegistered, drillbitUnregistered, isDrillbitInState, removeDrillbitStatusListenerpublic ZKClusterCoordinator(String connect, String zkRoot, String clusterId, int retryCount, int retryDelayMs, int connectTimeoutMs) throws IOException
IOExceptionpublic org.apache.curator.framework.CuratorFramework getCurator()
public void start(long millisToWait)
throws Exception
ClusterCoordinatorstart in class ClusterCoordinatormillisToWait - The maximum time to wait before throwing an exception if the
cluster coordination service has not successfully started. Use 0
to wait indefinitely.Exception - in case when unable to start coordinatorpublic ClusterCoordinator.RegistrationHandle register(CoordinationProtos.DrillbitEndpoint data)
register in class ClusterCoordinatorpublic void unregister(ClusterCoordinator.RegistrationHandle handle)
unregister in class ClusterCoordinatorpublic Collection<CoordinationProtos.DrillbitEndpoint> getAvailableEndpoints()
ClusterCoordinatorgetAvailableEndpoints 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 configurationprotected org.apache.curator.x.discovery.ServiceInstance<CoordinationProtos.DrillbitEndpoint> newServiceInstance(CoordinationProtos.DrillbitEndpoint endpoint) throws Exception
Exceptionprotected org.apache.curator.x.discovery.ServiceDiscovery<CoordinationProtos.DrillbitEndpoint> newDiscovery()
public Collection<CoordinationProtos.DrillbitEndpoint> getOnlineEndPoints()
ClusterCoordinatorgetOnlineEndPoints in class ClusterCoordinatorpublic ClusterCoordinator.RegistrationHandle update(ClusterCoordinator.RegistrationHandle handle, CoordinationProtos.DrillbitEndpoint.State state)
update in class ClusterCoordinatorCopyright © 2021 The Apache Software Foundation. All rights reserved.