I
- Vertex idV
- Vertex dataE
- Edge datapublic class DefaultVertexResolver<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends DefaultImmutableClassesGiraphConfigurable<I,V,E> implements VertexResolver<I,V,E>
Constructor and Description |
---|
DefaultVertexResolver() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEdges(Vertex<I,V,E> vertex,
VertexChanges<I,V,E> vertexChanges)
Add edges to the Vertex.
|
protected Vertex<I,V,E> |
addVertexIfDesired(I vertexId,
Vertex<I,V,E> vertex,
VertexChanges<I,V,E> vertexChanges,
boolean hasMessages)
Add the Vertex if desired.
|
protected boolean |
hasEdgeAdditions(VertexChanges<I,V,E> changes)
Check if changes contain edge addition requests
|
protected boolean |
hasEdgeRemovals(VertexChanges<I,V,E> changes)
Check if changes contain edge removal requests
|
protected boolean |
hasVertexAdditions(VertexChanges<I,V,E> changes)
Check if changes contain vertex addition requests
|
protected boolean |
hasVertexRemovals(VertexChanges<I,V,E> changes)
Check if changes contain vertex removal requests
|
protected void |
removeEdges(Vertex<I,V,E> vertex,
VertexChanges<I,V,E> vertexChanges)
Remove edges as specifed in changes given.
|
protected Vertex<I,V,E> |
removeVertexIfDesired(Vertex<I,V,E> vertex,
VertexChanges<I,V,E> vertexChanges)
Remove the vertex itself if the changes desire it.
|
Vertex<I,V,E> |
resolve(I vertexId,
Vertex<I,V,E> vertex,
VertexChanges<I,V,E> vertexChanges,
boolean hasMessages)
A vertex may have been removed, created zero or more times and had
zero or more messages sent to it.
|
void |
setConf(ImmutableClassesGiraphConfiguration<I,V,E> conf)
Set the configuration to be used by this object.
|
getConf
public Vertex<I,V,E> resolve(I vertexId, Vertex<I,V,E> vertex, VertexChanges<I,V,E> vertexChanges, boolean hasMessages)
VertexResolver
resolve
in interface VertexResolver<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
vertexId
- Vertex id (can be used for Vertex
's initialize())vertex
- Original vertex or null if nonevertexChanges
- Changes that happened to this vertex or null if nonehasMessages
- True iff vertex received messages in the last superstepprotected void removeEdges(Vertex<I,V,E> vertex, VertexChanges<I,V,E> vertexChanges)
vertex
- Vertex to remove edges fromvertexChanges
- contains list of edges to remove.protected Vertex<I,V,E> removeVertexIfDesired(Vertex<I,V,E> vertex, VertexChanges<I,V,E> vertexChanges)
vertex
- Vertex to remove.vertexChanges
- specifies if we should remove vertexprotected Vertex<I,V,E> addVertexIfDesired(I vertexId, Vertex<I,V,E> vertex, VertexChanges<I,V,E> vertexChanges, boolean hasMessages)
vertexId
- ID of vertexvertex
- Vertex, if not null just returns it as vertex already existsvertexChanges
- specifies if we should add the vertexhasMessages
- true if this vertex received any messagesprotected void addEdges(Vertex<I,V,E> vertex, VertexChanges<I,V,E> vertexChanges)
vertex
- Vertex to add edges tovertexChanges
- contains edges to addprotected boolean hasVertexRemovals(VertexChanges<I,V,E> changes)
changes
- VertexChanges to checkprotected boolean hasVertexAdditions(VertexChanges<I,V,E> changes)
changes
- VertexChanges to checkprotected boolean hasEdgeAdditions(VertexChanges<I,V,E> changes)
changes
- VertexChanges to checkprotected boolean hasEdgeRemovals(VertexChanges<I,V,E> changes)
changes
- VertexChanges to checkpublic void setConf(ImmutableClassesGiraphConfiguration<I,V,E> conf)
GiraphConfigurationSettable
setConf
in interface GiraphConfigurationSettable<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
setConf
in class DefaultImmutableClassesGiraphConfigurable<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
conf
- Set configurationCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.