public class DefaultDeploymentStateRecalculator extends java.lang.Object implements SupervisorElectionListener
Modifier and Type | Field and Description |
---|---|
protected JobFactory |
jobFactory
Factory to construct
Job instance |
protected DeploymentUnitStateCalculator |
stateCalculator
Deployment unit state calculator
|
protected StreamFactory |
streamFactory
Factory to construct
Stream instance |
Constructor and Description |
---|
DefaultDeploymentStateRecalculator() |
Modifier and Type | Method and Description |
---|---|
void |
onSupervisorElected(SupervisorElectedEvent supervisorElectedEvent)
The action to perform after the admin leader is elected.
|
void |
recalculateJobStates(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.
|
void |
recalculateStreamStates(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.
|
@Autowired protected StreamFactory streamFactory
Stream
instance@Autowired protected JobFactory jobFactory
Job
instance@Autowired protected DeploymentUnitStateCalculator stateCalculator
public void recalculateStreamStates(org.apache.curator.framework.recipes.cache.PathChildrenCache streamDeployments) throws java.lang.Exception
java.lang.Exception
public void recalculateJobStates(org.apache.curator.framework.recipes.cache.PathChildrenCache jobDeployments) throws java.lang.Exception
java.lang.Exception
public void onSupervisorElected(SupervisorElectedEvent supervisorElectedEvent) throws java.lang.Exception
SupervisorElectionListener
onSupervisorElected
in interface SupervisorElectionListener
supervisorElectedEvent
- the leader elected eventjava.lang.Exception