public abstract class InitialDeploymentListener
extends java.lang.Object
implements org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
Modifier and Type | Field and Description |
---|---|
protected ContainerMatcher |
containerMatcher
Container matcher for matching modules to containers.
|
protected ContainerRepository |
containerRepository
Repository from which to obtain containers in the cluster.
|
protected ModuleDeploymentWriter |
moduleDeploymentWriter
Utility for writing module deployment requests to ZooKeeper.
|
protected DeploymentUnitStateCalculator |
stateCalculator
State calculator for stream state.
|
Constructor and Description |
---|
InitialDeploymentListener(ZooKeeperConnection zkConnection,
org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests,
ContainerRepository containerRepository,
ContainerMatcher containerMatcher,
DeploymentUnitStateCalculator stateCalculator)
Construct a
PrimaryDeploymentListener . |
Modifier and Type | Method and Description |
---|---|
void |
childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
Handle child events for the
Paths.STREAMS path. |
protected void |
createModuleDeploymentRequestsPath(org.apache.curator.framework.CuratorFramework client,
ModuleDescriptor descriptor,
RuntimeModuleDeploymentProperties deploymentProperties)
Create
ModuleDeploymentRequestsPath for the given ModuleDescriptor and
the RuntimeModuleDeploymentProperties . |
protected abstract void |
onChildAdded(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.ChildData data)
Handle the new deployment requests.
|
protected void |
onChildRemoved(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.ChildData data)
Handle the removal of module deployment requests.
|
protected final ContainerMatcher containerMatcher
protected final ContainerRepository containerRepository
protected final ModuleDeploymentWriter moduleDeploymentWriter
protected final DeploymentUnitStateCalculator stateCalculator
public InitialDeploymentListener(ZooKeeperConnection zkConnection, org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests, ContainerRepository containerRepository, ContainerMatcher containerMatcher, DeploymentUnitStateCalculator stateCalculator)
PrimaryDeploymentListener
.zkConnection
- ZooKeeper connectionmoduleDeploymentRequests
- the requested module deploymentscontainerRepository
- repository to obtain container datacontainerMatcher
- matches modules to containersstateCalculator
- calculator for stream statepublic void childEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event) throws java.lang.Exception
Paths.STREAMS
path.childEvent
in interface org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
java.lang.Exception
protected abstract void onChildAdded(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.ChildData data) throws java.lang.Exception
client
- the curator clientdata
- the data that represents the module deploymentsjava.lang.Exception
protected void onChildRemoved(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.ChildData data) throws java.lang.Exception
client
- the curator clientdata
- the module deployment datajava.lang.Exception
protected void createModuleDeploymentRequestsPath(org.apache.curator.framework.CuratorFramework client, ModuleDescriptor descriptor, RuntimeModuleDeploymentProperties deploymentProperties)
ModuleDeploymentRequestsPath
for the given ModuleDescriptor
and
the RuntimeModuleDeploymentProperties
.client
- the curator clientdescriptor
- the module descriptordeploymentProperties
- the runtime deployment properties