Class SccVertexValue
- java.lang.Object
 - 
- com.alibaba.graphscope.example.giraph.SccVertexValue
 
 
- 
- All Implemented Interfaces:
 org.apache.hadoop.io.Writable
public class SccVertexValue extends Object implements org.apache.hadoop.io.Writable
Vertex value for the Strongly Connected Components algorithm. It keeps track of the parents of the vertex in order to traverse the graph backwards. 
- 
- 
Constructor Summary
Constructors Constructor Description SccVertexValue()Public constructor required for serialization.SccVertexValue(long value)Constructor 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParent(long vertexId)Adds a vertex id to the list of parent vertices.voidclearParents()Clear parents list.voiddeactivate()Remove this vertex from the computation.longget()Returns the vertex value.ArrayList<Long>getParents()Returns the list of parent vertices, i.e., vertices that are at the other end of incoming edges.booleanisActive()Indicates whether the vertex was removed in a Trimming phase.voidreadFields(DataInput in)voidset(long value)Sets the vertex value.StringtoString()voidwrite(DataOutput out) 
 - 
 
- 
- 
Method Detail
- 
readFields
public void readFields(DataInput in) throws IOException
- Specified by:
 readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
 IOException
 
- 
write
public void write(DataOutput out) throws IOException
- Specified by:
 writein interfaceorg.apache.hadoop.io.Writable- Throws:
 IOException
 
- 
getParents
public ArrayList<Long> getParents()
Returns the list of parent vertices, i.e., vertices that are at the other end of incoming edges. If the vertex doesn't have any incoming edge, it returns null.- Returns:
 - List of the vertex's parents.
 
 
- 
addParent
public void addParent(long vertexId)
Adds a vertex id to the list of parent vertices.- Parameters:
 vertexId- It of the parent vertex.
 
- 
clearParents
public void clearParents()
Clear parents list. 
- 
set
public void set(long value)
Sets the vertex value. At the end of the SCC computation, vertices with the same vertex value are part of the same component.- Parameters:
 value- Vertex value.
 
- 
get
public long get()
Returns the vertex value. At the end of the SCC computation, vertices with the same vertex value are part of the same component.- Returns:
 - Current vertex value.
 
 
- 
deactivate
public void deactivate()
Remove this vertex from the computation. 
- 
isActive
public boolean isActive()
Indicates whether the vertex was removed in a Trimming phase.- Returns:
 - True if the vertex was trimmed, otherwise, return false.
 
 
 - 
 
 -