public class StreamDeploymentListener extends InitialDeploymentListener
containerMatcher, containerRepository, moduleDeploymentWriter, stateCalculator
Constructor and Description |
---|
StreamDeploymentListener(ZooKeeperConnection zkConnection,
org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests,
ContainerRepository containerRepository,
StreamFactory streamFactory,
ContainerMatcher containerMatcher,
DeploymentUnitStateCalculator stateCalculator)
Construct a StreamDeploymentListener.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onChildAdded(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.ChildData data)
Handle the creation of a new stream deployment.
|
void |
recalculateStreamStates(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCache streamDeployments)
Iterate all deployed streams, recalculate the state of each, and create
an ephemeral node indicating the stream state.
|
childEvent, createModuleDeploymentRequestsPath, onChildRemoved
public StreamDeploymentListener(ZooKeeperConnection zkConnection, org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests, ContainerRepository containerRepository, StreamFactory streamFactory, ContainerMatcher containerMatcher, DeploymentUnitStateCalculator stateCalculator)
zkConnection
- ZooKeeper connectionmoduleDeploymentRequests
- the requested deployment modulescontainerRepository
- repository to obtain container datastreamFactory
- factory to construct Stream
containerMatcher
- matches modules to containersstateCalculator
- calculator for stream stateprotected void onChildAdded(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.ChildData data) throws java.lang.Exception
onChildAdded
in class InitialDeploymentListener
client
- curator clientdata
- stream deployment request datajava.lang.Exception
public void recalculateStreamStates(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCache streamDeployments) throws java.lang.Exception
client
- curator clientstreamDeployments
- curator cache of stream deploymentsjava.lang.Exception