org.apache.giraph.graph
Interface VertexResolver<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>

Type Parameters:
I - Vertex id
V - Vertex data
E - Edge data
M - Message data
All Superinterfaces:
GraphStateAware<I,V,E,M>
All Known Implementing Classes:
DefaultVertexResolver

public interface VertexResolver<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
extends GraphStateAware<I,V,E,M>

Handles all the situations that can arise upon creation/removal of vertices and edges.


Method Summary
 Vertex<I,V,E,M> resolve(I vertexId, Vertex<I,V,E,M> vertex, VertexChanges<I,V,E,M> vertexChanges, boolean hasMessages)
          A vertex may have been removed, created zero or more times and had zero or more messages sent to it.
 void setGraphState(GraphState<I,V,E,M> graphState)
          Set the graph state.
 
Methods inherited from interface org.apache.giraph.graph.GraphStateAware
getGraphState
 

Method Detail

resolve

Vertex<I,V,E,M> resolve(I vertexId,
                        Vertex<I,V,E,M> vertex,
                        VertexChanges<I,V,E,M> vertexChanges,
                        boolean hasMessages)
A vertex may have been removed, created zero or more times and had zero or more messages sent to it. This method will handle all situations excluding the normal case (a vertex already exists and has zero or more messages sent it to).

Parameters:
vertexId - Vertex id (can be used for Vertex's initialize())
vertex - Original vertex or null if none
vertexChanges - Changes that happened to this vertex or null if none
hasMessages - True iff vertex received messages in the last superstep
Returns:
Vertex to be returned, if null, and a vertex currently exists it will be removed

setGraphState

void setGraphState(GraphState<I,V,E,M> graphState)
Set the graph state.

Specified by:
setGraphState in interface GraphStateAware<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
Parameters:
graphState - Graph state saved.


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.