Package org.apache.drill.exec.coord.zk
Class ZKClusterCoordinator
java.lang.Object
org.apache.drill.exec.coord.ClusterCoordinator
org.apache.drill.exec.coord.zk.ZKClusterCoordinator
- All Implemented Interfaces:
- AutoCloseable
Manages cluster coordination utilizing zookeeper. *
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.drill.exec.coord.ClusterCoordinatorClusterCoordinator.RegistrationHandle
- 
Field SummaryFields inherited from class org.apache.drill.exec.coord.ClusterCoordinatorlisteners
- 
Constructor SummaryConstructorsConstructorDescriptionZKClusterCoordinator(DrillConfig config, String connect) ZKClusterCoordinator(DrillConfig config, String connect, boolean createNamespace, org.apache.curator.framework.api.ACLProvider aclProvider) ZKClusterCoordinator(DrillConfig config, org.apache.curator.framework.api.ACLProvider aclProvider) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Get a collection of available Drillbit endpoints, Thread-safe.org.apache.curator.framework.CuratorFrameworkGet a collection of ONLINE drillbit endpoints by excluding the drillbits that are in QUIESCENT state (drillbits that are shutting down).<V> TransientStore<V> getOrCreateTransientStore(TransientStoreConfig<V> config) Returns astoreinstance with the givenconfiguration.getSemaphore(String name, int maximumLeases) protected org.apache.curator.x.discovery.ServiceDiscovery<CoordinationProtos.DrillbitEndpoint> protected org.apache.curator.x.discovery.ServiceInstance<CoordinationProtos.DrillbitEndpoint> voidstart(long millisToWait) Start the cluster coordinator.voidupdate(ClusterCoordinator.RegistrationHandle handle, CoordinationProtos.DrillbitEndpoint.State state) Update drillbit endpoint state.Methods inherited from class org.apache.drill.exec.coord.ClusterCoordinatoraddDrillbitStatusListener, drillbitRegistered, drillbitUnregistered, isDrillbitInState, removeDrillbitStatusListener
- 
Constructor Details- 
ZKClusterCoordinator- Throws:
- Exception
 
- 
ZKClusterCoordinatorpublic ZKClusterCoordinator(DrillConfig config, org.apache.curator.framework.api.ACLProvider aclProvider) throws Exception - Throws:
- Exception
 
- 
ZKClusterCoordinatorpublic ZKClusterCoordinator(DrillConfig config, String connect, boolean createNamespace, org.apache.curator.framework.api.ACLProvider aclProvider) throws Exception - Throws:
- Exception
 
 
- 
- 
Method Details- 
getCuratorpublic org.apache.curator.framework.CuratorFramework getCurator()
- 
startDescription copied from class:ClusterCoordinatorStart the cluster coordinator. Millis to wait is- Specified by:
- startin class- ClusterCoordinator
- Parameters:
- millisToWait- The maximum time to wait before throwing an exception if the cluster coordination service has not successfully started. Use 0 to wait indefinitely.
- Throws:
- Exception- in case when unable to start coordinator
 
- 
close- Throws:
- Exception
 
- 
register- Specified by:
- registerin class- ClusterCoordinator
 
- 
unregister- Specified by:
- unregisterin class- ClusterCoordinator
 
- 
updatepublic ClusterCoordinator.RegistrationHandle update(ClusterCoordinator.RegistrationHandle handle, CoordinationProtos.DrillbitEndpoint.State state) Update drillbit endpoint state. Drillbit advertises its state in Zookeeper when a shutdown request of drillbit is triggered. State information is used during planning and initial client connection phases.- Specified by:
- updatein class- ClusterCoordinator
 
- 
getAvailableEndpointsDescription copied from class:ClusterCoordinatorGet a collection of available Drillbit endpoints, Thread-safe. Could be slightly out of date depending on refresh policy.- Specified by:
- getAvailableEndpointsin class- ClusterCoordinator
- Returns:
- A collection of available endpoints.
 
- 
getOnlineEndPointsDescription copied from class:ClusterCoordinatorGet a collection of ONLINE drillbit endpoints by excluding the drillbits that are in QUIESCENT state (drillbits that are shutting down). Primarily used by the planner to plan queries only on ONLINE drillbits and used by the client during initial connection phase to connect to a drillbit (foreman)- Specified by:
- getOnlineEndPointsin class- ClusterCoordinator
- Returns:
- A collection of ONLINE endpoints
 
- 
getSemaphore- Specified by:
- getSemaphorein class- ClusterCoordinator
 
- 
getOrCreateTransientStoreDescription copied from class:ClusterCoordinatorReturns astoreinstance with the givenconfiguration. Note that implementor might cache the instance so new instance creation is not guaranteed.- Specified by:
- getOrCreateTransientStorein class- ClusterCoordinator
- Type Parameters:
- V- value type for this store
- Parameters:
- config- store configuration
 
- 
newServiceInstanceprotected org.apache.curator.x.discovery.ServiceInstance<CoordinationProtos.DrillbitEndpoint> newServiceInstance(CoordinationProtos.DrillbitEndpoint endpoint) throws Exception - Throws:
- Exception
 
- 
newDiscoveryprotected org.apache.curator.x.discovery.ServiceDiscovery<CoordinationProtos.DrillbitEndpoint> newDiscovery()
 
-