public class JobDeploymentListener extends InitialDeploymentListener
containerMatcher, containerRepository, moduleDeploymentWriter, stateCalculator
Constructor and Description |
---|
JobDeploymentListener(ZooKeeperConnection zkConnection,
org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests,
ContainerRepository containerRepository,
JobFactory jobFactory,
org.springframework.xd.dirt.server.ContainerMatcher containerMatcher,
ModuleDeploymentWriter moduleDeploymentWriter,
DeploymentUnitStateCalculator stateCalculator)
Construct a JobDeploymentListener.
|
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 job deployment.
|
void |
recalculateJobStates(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCache jobDeployments)
Iterate all deployed jobs, recalculate the deployment status of each, and
create an ephemeral node indicating the job state.
|
childEvent, createModuleDeploymentRequestsPath, onChildRemoved
public JobDeploymentListener(ZooKeeperConnection zkConnection, org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests, ContainerRepository containerRepository, JobFactory jobFactory, org.springframework.xd.dirt.server.ContainerMatcher containerMatcher, ModuleDeploymentWriter moduleDeploymentWriter, DeploymentUnitStateCalculator stateCalculator)
zkConnection
- ZooKeeper connectionmoduleDeploymentRequests
- the requested module deploymentscontainerRepository
- repository to obtain container datajobFactory
- factory to construct Job
containerMatcher
- matches modules to containersstateCalculator
- calculator for job 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
- job deployment request datajava.lang.Exception
public void recalculateJobStates(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCache jobDeployments) throws java.lang.Exception
client
- curator clientjobDeployments
- curator cache of job deploymentsjava.lang.Exception