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,
ContainerMatcher containerMatcher,
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, onChildRemovedpublic JobDeploymentListener(ZooKeeperConnection zkConnection, org.apache.curator.framework.recipes.cache.PathChildrenCache moduleDeploymentRequests, ContainerRepository containerRepository, JobFactory jobFactory, ContainerMatcher containerMatcher, DeploymentUnitStateCalculator stateCalculator)
zkConnection - ZooKeeper connectionmoduleDeploymentRequests - the requested module deploymentscontainerRepository - repository to obtain container datajobFactory - factory to construct JobcontainerMatcher - 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 InitialDeploymentListenerclient - curator clientdata - job deployment request datajava.lang.Exceptionpublic 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