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 void
addParent(long vertexId)
Adds a vertex id to the list of parent vertices.void
clearParents()
Clear parents list.void
deactivate()
Remove this vertex from the computation.long
get()
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.boolean
isActive()
Indicates whether the vertex was removed in a Trimming phase.void
readFields(DataInput in)
void
set(long value)
Sets the vertex value.String
toString()
void
write(DataOutput out)
-
-
-
Method Detail
-
readFields
public void readFields(DataInput in) throws IOException
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Throws:
IOException
-
write
public void write(DataOutput out) throws IOException
- Specified by:
write
in 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.
-
-