public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp) { final Set<AbstractInstance> tempSet = new HashSet<AbstractInstance>(); // First determine the number of allocated instances in the current stage final ExecutionGroupVertexIterator it = new ExecutionGroupVertexIterator( this.executionGraph, true, this.executionGraph.getIndexOfCurrentExecutionStage()); while (it.hasNext()) { final ExecutionGroupVertex groupVertex = it.next(); for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) { final ExecutionVertex executionVertex = groupVertex.getGroupMember(i); final AbstractInstance instance = executionVertex.getAllocatedResource().getInstance(); if (!(instance instanceof DummyInstance)) { tempSet.add(instance); } } } /* * Now compare the size of the collected data set and the allocated instance set. * If their sizes are equal we can issue an instance summary. */ if (tempSet.size() != this.collectedInstanceProfilingData.size()) { return null; } return constructInstanceSummary(timestamp); }
public boolean instanceAllocatedByJob(InternalInstanceProfilingData instanceProfilingData) { final ExecutionGroupVertexIterator it = new ExecutionGroupVertexIterator( this.executionGraph, true, this.executionGraph.getIndexOfCurrentExecutionStage()); while (it.hasNext()) { final ExecutionGroupVertex groupVertex = it.next(); for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) { final ExecutionVertex executionVertex = groupVertex.getGroupMember(i); if (instanceProfilingData .getInstanceConnectionInfo() .equals( executionVertex.getAllocatedResource().getInstance().getInstanceConnectionInfo())) { this.collectedInstanceProfilingData.put( instanceProfilingData.getInstanceConnectionInfo(), instanceProfilingData); return true; } } } return false; }