@Override public void remove() throws IOException { MapWritable msg = new MapWritable(); msg.put(GraphJobRunner.FLAG_VERTEX_DECREASE, this.vertexID); // Get master task peer. String destPeer = GraphJobRunner.getMasterTask(this.getPeer()); runner.getPeer().send(destPeer, new GraphJobMessage(msg)); alterVertexCounter(-1); }
@Override public void addVertex(V vertexID, List<Edge<V, E>> edges, M value) throws IOException { MapWritable msg = new MapWritable(); // Create the new vertex. Vertex<V, E, M> vertex = GraphJobRunner.<V, E, M>newVertexInstance(GraphJobRunner.VERTEX_CLASS); vertex.setEdges(edges); vertex.setValue(value); vertex.setVertexID(vertexID); msg.put(GraphJobRunner.FLAG_VERTEX_INCREASE, vertex); runner.getPeer().send(runner.getHostName(vertexID), new GraphJobMessage(msg)); alterVertexCounter(1); }