final ExecutionGraph eg = this.executionVertex.getExecutionGraph();
// Check if we can deploy a new pipeline.
if (newExecutionState == ExecutionState.FINISHING) {
final ExecutionPipeline pipeline = this.executionVertex.getExecutionPipeline();
if (!pipeline.isFinishing()) {
// Some tasks of the pipeline are still running
return;
}
// Find another vertex in the group which is still in SCHEDULED state and get its pipeline.
final ExecutionGroupVertex groupVertex = this.executionVertex.getGroupVertex();
for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); ++i) {
final ExecutionVertex groupMember = groupVertex.getGroupMember(i);
if (groupMember.compareAndUpdateExecutionState(ExecutionState.SCHEDULED, ExecutionState.ASSIGNED)) {
final ExecutionPipeline pipelineToBeDeployed = groupMember.getExecutionPipeline();
pipelineToBeDeployed.setAllocatedResource(this.executionVertex.getAllocatedResource());
pipelineToBeDeployed.updateExecutionState(ExecutionState.ASSIGNED);
this.scheduler.deployAssignedPipeline(pipelineToBeDeployed);
return;
}
}