public void executionStateChanged(JobID jobID, JobVertexID vertexId, int subtask, ExecutionAttemptID executionId,
ExecutionState newExecutionState, String optionalMessage)
{
final long timestamp = System.currentTimeMillis();
final ExecutionJobVertex vertex = graph.getJobVertex(vertexId);
final String taskName = vertex == null ? "(null)" : vertex.getJobVertex().getName();
final int totalNumberOfSubtasks = vertex == null ? -1 : vertex.getParallelism();
// Create a new vertex event
final VertexEvent vertexEvent = new VertexEvent(timestamp, vertexId, taskName, totalNumberOfSubtasks,
subtask, executionId, newExecutionState, optionalMessage);