/** * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex. * * <p>This should be called at most once per updateVertex. * * @param newValue The new vertex value. */ public void setNewVertexValue(VV newValue) { if (setNewVertexValueCalled) { throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex"); } setNewVertexValueCalled = true; if (isOptDegrees()) { outValWithDegrees.f1.f0 = newValue; outWithDegrees.collect(outValWithDegrees); } else { outVal.setValue(newValue); out.collect(outVal); } }
@Override public void sendMessages(Vertex<K, Double> vertex) { if (getSuperstepNumber() == 1) { // initialize vertex ranks vertex.setValue(1.0 / this.getNumberOfVertices()); } for (Edge<K, Double> edge : getEdges()) { sendMessageTo(edge.getTarget(), vertex.getValue() * edge.getValue()); } } }
/** * Map function to create gelly vertices with long key and long value. * * @param tuple given unique vertex id * @return gelly vertex */ @Override public Vertex<Long, Long> map(Tuple2<Long, GradoopId> tuple) { vertex.setId(tuple.f0); vertex.setValue(tuple.f0); return vertex; } }
/** * Map function to create gelly vertices with long key and long value. * * @param tuple given unique vertex id * @return gelly vertex */ @Override public Vertex<Long, Long> map(Tuple2<Long, GradoopId> tuple) { vertex.setId(tuple.f0); vertex.setValue(tuple.f0); return vertex; } }
/** * Constructor. */ public VertexToGellyVertexWithNullValue() { reuseVertex = new org.apache.flink.graph.Vertex<>(); reuseVertex.setValue(NullValue.getInstance()); }
@Override public org.apache.flink.graph.Vertex<GradoopId, GradoopId> map(Vertex epgmVertex) { GradoopId id = epgmVertex.getId(); reuseVertex.setId(id); reuseVertex.setValue(id); return reuseVertex; } }
/** * Constructor. */ public VertexToGellyVertexWithNullValue() { reuseVertex = new org.apache.flink.graph.Vertex<>(); reuseVertex.setValue(NullValue.getInstance()); }
@Override public org.apache.flink.graph.Vertex<GradoopId, GradoopId> map(Vertex epgmVertex) { GradoopId id = epgmVertex.getId(); reuseVertex.setId(id); reuseVertex.setValue(id); return reuseVertex; } }
@Override public org.apache.flink.graph.Vertex<GradoopId, PropertyValue> map( Vertex epgmVertex) throws Exception { reuseVertex.setId(epgmVertex.getId()); reuseVertex.setValue(epgmVertex.getPropertyValue(propertyKey)); return reuseVertex; } }
@Override public org.apache.flink.graph.Vertex<GradoopId, PropertyValue> map( Vertex epgmVertex) throws Exception { reuseVertex.setId(epgmVertex.getId()); reuseVertex.setValue(epgmVertex.getPropertyValue(propertyKey)); return reuseVertex; } }
/** * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex. * * This should be called at most once per updateVertex. * * @param newValue The new vertex value. */ public void setNewVertexValue(VV newValue) { if(setNewVertexValueCalled) { throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex"); } setNewVertexValueCalled = true; if(isOptDegrees()) { outValWithDegrees.f1.f0 = newValue; outWithDegrees.collect(outValWithDegrees); } else { outVal.setValue(newValue); out.collect(outVal); } }
/** * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex. * * <p>This should be called at most once per updateVertex. * * @param newValue The new vertex value. */ public void setNewVertexValue(VV newValue) { if (setNewVertexValueCalled) { throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex"); } setNewVertexValueCalled = true; if (isOptDegrees()) { outValWithDegrees.f1.f0 = newValue; outWithDegrees.collect(outValWithDegrees); } else { outVal.setValue(newValue); out.collect(outVal); } }
/** * Sets the new value of this vertex. Setting a new value triggers the sending of outgoing messages from this vertex. * * <p>This should be called at most once per updateVertex. * * @param newValue The new vertex value. */ public void setNewVertexValue(VV newValue) { if (setNewVertexValueCalled) { throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex"); } setNewVertexValueCalled = true; if (isOptDegrees()) { outValWithDegrees.f1.f0 = newValue; outWithDegrees.collect(outValWithDegrees); } else { outVal.setValue(newValue); out.collect(outVal); } }