@Override public void doRequest(ServerData<I, V, E> serverData) { ConcurrentHashMap<I, VertexMutations<I, V, E>> vertexMutations = serverData.getVertexMutations(); Histogram verticesInMutationHist = GiraphMetrics.get() .perSuperstep() .getUniformHistogram(MetricNames.VERTICES_IN_MUTATION_REQUEST); verticesInMutationHist.update(vertexMutations.size()); for (Entry<I, VertexMutations<I, V, E>> entry : vertexIdMutations.entrySet()) { VertexMutations<I, V, E> mutations = vertexMutations.get(entry.getKey()); if (mutations == null) { mutations = vertexMutations.putIfAbsent(entry.getKey(), entry.getValue()); if (mutations == null) { continue; } } synchronized (mutations) { mutations.addVertexMutations(entry.getValue()); } } }
/** Constructor */ public OutboundByteCounter() { // Initialize Metrics GiraphMetrics.get().addSuperstepResetObserver(this); }