// LOG.info("Created receiverNotReady for " + connectedVertex + " 1");
return ConnectionInfoLookupResponse.createReceiverNotReady();
}
// Check execution state
final ExecutionState executionState = connectedVertex.getExecutionState();
if (executionState == ExecutionState.FINISHED) {
// that should not happen. if there is data pending, the receiver cannot be ready
return ConnectionInfoLookupResponse.createReceiverNotFound();
}
// running is common, finishing is happens when the lookup is for the close event
if (executionState != ExecutionState.RUNNING && executionState != ExecutionState.FINISHING) {
// LOG.info("Created receiverNotReady for " + connectedVertex + " in state " + executionState + " 2");
return ConnectionInfoLookupResponse.createReceiverNotReady();
}
if (assignedInstance.getInstanceConnectionInfo().equals(caller)) {
// Receiver runs on the same task manager
return ConnectionInfoLookupResponse.createReceiverFoundAndReady(edge.getOutputChannelID());
} else {
// Receiver runs on a different task manager
final InstanceConnectionInfo ici = assignedInstance.getInstanceConnectionInfo();
final InetSocketAddress isa = new InetSocketAddress(ici.address(), ici.dataPort());
return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, edge.getConnectionID()));
}
}
// else, the request is for an output channel
// Find vertex of connected input channel
final ExecutionVertex targetVertex = edge.getInputGate().getVertex();
// Check execution state
final ExecutionState executionState = targetVertex.getExecutionState();
// check whether the task needs to be deployed
if (executionState != ExecutionState.RUNNING && executionState != ExecutionState.FINISHING && executionState != ExecutionState.FINISHED) {
if (executionState == ExecutionState.ASSIGNED) {