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, removeDrillbitStatusListener
public ZKClusterCoordinator(String connect, String zkRoot, String clusterId, int retryCount, int retryDelayMs, int connectTimeoutMs) throws IOException
IOException
public org.apache.curator.framework.CuratorFramework getCurator()
public void start(long millisToWait) throws Exception
ClusterCoordinator
start
in class ClusterCoordinator
millisToWait
- 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 ClusterCoordinator
public void unregister(ClusterCoordinator.RegistrationHandle handle)
unregister
in class ClusterCoordinator
public Collection<CoordinationProtos.DrillbitEndpoint> getAvailableEndpoints()
ClusterCoordinator
getAvailableEndpoints
in class ClusterCoordinator
public DistributedSemaphore getSemaphore(String name, int maximumLeases)
getSemaphore
in class ClusterCoordinator
public <V> TransientStore<V> getOrCreateTransientStore(TransientStoreConfig<V> config)
ClusterCoordinator
store
instance with the given configuration
.
Note that implementor might cache the instance so new instance creation is not guaranteed.getOrCreateTransientStore
in class ClusterCoordinator
V
- value type for this storeconfig
- store configurationprotected org.apache.curator.x.discovery.ServiceInstance<CoordinationProtos.DrillbitEndpoint> newServiceInstance(CoordinationProtos.DrillbitEndpoint endpoint) throws Exception
Exception
protected org.apache.curator.x.discovery.ServiceDiscovery<CoordinationProtos.DrillbitEndpoint> newDiscovery()
public Collection<CoordinationProtos.DrillbitEndpoint> getOnlineEndPoints()
ClusterCoordinator
getOnlineEndPoints
in class ClusterCoordinator
public ClusterCoordinator.RegistrationHandle update(ClusterCoordinator.RegistrationHandle handle, CoordinationProtos.DrillbitEndpoint.State state)
update
in class ClusterCoordinator
Copyright © 1970 The Apache Software Foundation. All rights reserved.