Package com.alibaba.graphscope.fragment
Interface IFragment<OID_T,VID_T,VDATA_T,EDATA_T>
-
- Type Parameters:
OID_T
- original vertex id type.VID_T
- vertex id type.VDATA_T
- vertex data type.EDATA_T
- edge data type.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractArrowProjectedAdaptor
,ArrowProjectedAdaptor
,ImmutableEdgecutFragmentAdaptor
public interface IFragment<OID_T,VID_T,VDATA_T,EDATA_T> extends Serializable
IFragment defines a simple fragment interface, which conforms two different simple fragmentArrowProjectedFragment
andImmutableEdgecutFragment
into one.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
fid()
int
fnum()
Number of fragments.FragmentType
fragmentType()
Return the underlying fragment type,i.e.VDATA_T
getData(Vertex<VID_T> vertex)
Get the data on vertex.Class<? extends EDATA_T>
getEdataClass()
long
getEdgeNum()
Returns the number of edges in this fragment.com.alibaba.fastffi.FFIPointer
getFFIPointer()
Get the actual fragment FFIPointer we are using.int
getFragId(Vertex<VID_T> vertex)
To which fragment the vertex belongs.OID_T
getId(Vertex<VID_T> vertex)
Get the original Id of a vertex.AdjList<VID_T,EDATA_T>
getIncomingAdjList(Vertex<VID_T> vertex)
long
getInEdgeNum()
boolean
getInnerVertex(OID_T oid, Vertex<VID_T> vertex)
Check whether a vertex, represented in OID_T, is a inner vertex.VID_T
getInnerVertexGid(Vertex<VID_T> vertex)
Convert from outer vertex handle to its global id.OID_T
getInnerVertexId(Vertex<VID_T> vertex)
Obtain vertex id from original id, only for inner vertex.long
getInnerVerticesNum()
Get the number of inner vertices.int
getLocalInDegree(Vertex<VID_T> vertex)
int
getLocalOutDegree(Vertex<VID_T> vertex)
Class<? extends OID_T>
getOidClass()
long
getOutEdgeNum()
boolean
getOuterVertex(OID_T oid, Vertex<VID_T> vertex)
Check whether a vertex, represented in OID_T, is a outer vertex.VID_T
getOuterVertexGid(Vertex<VID_T> vertex)
Convert from inner vertex handle to its global id.OID_T
getOuterVertexId(Vertex<VID_T> vertex)
Obtain vertex id from original id, only for outer vertex.long
getOuterVerticesNum()
Get the number of outer vertices.AdjList<VID_T,EDATA_T>
getOutgoingAdjList(Vertex<VID_T> vertex)
long
getTotalVerticesNum()
Returns the number of vertices in the entire graph.Class<? extends VDATA_T>
getVdataClass()
boolean
getVertex(OID_T oid, Vertex<VID_T> vertex)
Get the vertex handle from the original id.VID_T
getVerticesNum()
Returns the number of vertices in this fragment.Class<? extends VID_T>
getVidClass()
boolean
gid2Vertex(VID_T gid, Vertex<VID_T> vertex)
boolean
innerVertexGid2Vertex(VID_T gid, Vertex<VID_T> vertex)
Convert from global id to an inner vertex handle.VertexRange<VID_T>
innerVertices()
Obtain vertex range contains all inner vertices.boolean
isInnerVertex(Vertex<VID_T> vertex)
Check whether a vertex is a inner vertex for a fragment.boolean
isOuterVertex(Vertex<VID_T> vertex)
Check whether a vertex is a outer vertex for a fragment.boolean
outerVertexGid2Vertex(VID_T gid, Vertex<VID_T> vertex)
Convert from global id to an outer vertex handle.VertexRange<VID_T>
outerVertices()
Obtain vertex range contains all outer vertices.void
setData(Vertex<VID_T> vertex, VDATA_T vdata)
Update vertex data with a new value.VID_T
vertex2Gid(Vertex<VID_T> vertex)
VertexRange<VID_T>
vertices()
Get all vertices referenced to this fragment.
-
-
-
Method Detail
-
fragmentType
FragmentType fragmentType()
Return the underlying fragment type,i.e. ArrowProjected or Simple.- Returns:
- underlying fragment type.
-
getFFIPointer
com.alibaba.fastffi.FFIPointer getFFIPointer()
Get the actual fragment FFIPointer we are using.- Returns:
- a ffipointer
-
fid
int fid()
- Returns:
- The id of current fragment.
-
fnum
int fnum()
Number of fragments.- Returns:
- number of fragments.
-
getEdgeNum
long getEdgeNum()
Returns the number of edges in this fragment.- Returns:
- the number of edges in this fragment.
-
getInEdgeNum
long getInEdgeNum()
-
getOutEdgeNum
long getOutEdgeNum()
-
getVerticesNum
VID_T getVerticesNum()
Returns the number of vertices in this fragment.- Returns:
- the number of vertices in this fragment.
-
getTotalVerticesNum
long getTotalVerticesNum()
Returns the number of vertices in the entire graph.- Returns:
- The number of vertices in the entire graph.
-
vertices
VertexRange<VID_T> vertices()
Get all vertices referenced to this fragment.- Returns:
- A vertex set can be iterate on.
-
getVertex
boolean getVertex(OID_T oid, Vertex<VID_T> vertex)
Get the vertex handle from the original id.- Parameters:
oid
- input original id.vertex
- output vertex handle- Returns:
- If find the vertex in this fragment, return true. Otherwise, return false.
-
getId
OID_T getId(Vertex<VID_T> vertex)
Get the original Id of a vertex.- Parameters:
vertex
- querying vertex.- Returns:
- original id.
-
getFragId
int getFragId(Vertex<VID_T> vertex)
To which fragment the vertex belongs.- Parameters:
vertex
- querying vertex.- Returns:
- frag id.
-
getInnerVerticesNum
long getInnerVerticesNum()
Get the number of inner vertices.- Returns:
- number of inner vertices.
-
getOuterVerticesNum
long getOuterVerticesNum()
Get the number of outer vertices.- Returns:
- umber of outer vertices.
-
innerVertices
VertexRange<VID_T> innerVertices()
Obtain vertex range contains all inner vertices.- Returns:
- vertex range.
-
outerVertices
VertexRange<VID_T> outerVertices()
Obtain vertex range contains all outer vertices.- Returns:
- vertex range.
-
isInnerVertex
boolean isInnerVertex(Vertex<VID_T> vertex)
Check whether a vertex is a inner vertex for a fragment.- Parameters:
vertex
- querying vertex.- Returns:
- true if is inner vertex.
-
isOuterVertex
boolean isOuterVertex(Vertex<VID_T> vertex)
Check whether a vertex is a outer vertex for a fragment.- Parameters:
vertex
- querying vertex.- Returns:
- true if is outer vertex.
-
getInnerVertex
boolean getInnerVertex(OID_T oid, Vertex<VID_T> vertex)
Check whether a vertex, represented in OID_T, is a inner vertex. If yes, if true and put inner representation id in the second param. Else return false.- Parameters:
oid
- querying vertex in OID_T.vertex
- placeholder for VID_T, if oid belongs to this fragment.- Returns:
- inner vertex or not.
-
getOuterVertex
boolean getOuterVertex(OID_T oid, Vertex<VID_T> vertex)
Check whether a vertex, represented in OID_T, is a outer vertex. If yes, if true and put outer representation id in the second param. Else return false.- Parameters:
oid
- querying vertex in OID_T.vertex
- placeholder for VID_T, if oid doesn't belong to this fragment.- Returns:
- outer vertex or not.
-
getInnerVertexId
OID_T getInnerVertexId(Vertex<VID_T> vertex)
Obtain vertex id from original id, only for inner vertex.- Parameters:
vertex
- querying vertex.- Returns:
- original id.
-
getOuterVertexId
OID_T getOuterVertexId(Vertex<VID_T> vertex)
Obtain vertex id from original id, only for outer vertex.- Parameters:
vertex
- querying vertex.- Returns:
- original id.
-
innerVertexGid2Vertex
boolean innerVertexGid2Vertex(VID_T gid, Vertex<VID_T> vertex)
Convert from global id to an inner vertex handle.- Parameters:
gid
- Input global id.vertex
- Output vertex handle.- Returns:
- True if exists an inner vertex of this fragment with global id as gid, false otherwise.
-
outerVertexGid2Vertex
boolean outerVertexGid2Vertex(VID_T gid, Vertex<VID_T> vertex)
Convert from global id to an outer vertex handle.- Parameters:
gid
- Input global id.vertex
- Output vertex handle.- Returns:
- True if exists an outer vertex of this fragment with global id as gid, false otherwise.
-
getOuterVertexGid
VID_T getOuterVertexGid(Vertex<VID_T> vertex)
Convert from inner vertex handle to its global id.- Parameters:
vertex
- Input vertex handle.- Returns:
- Global id of the vertex.
-
getInnerVertexGid
VID_T getInnerVertexGid(Vertex<VID_T> vertex)
Convert from outer vertex handle to its global id.- Parameters:
vertex
- Input vertex handle.- Returns:
- Global id of the vertex.
-
getData
VDATA_T getData(Vertex<VID_T> vertex)
Get the data on vertex.- Parameters:
vertex
- querying vertex.- Returns:
- vertex data
-
-