Interface IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>

    • Method Detail

      • getOidClass

        Class<? extends OID_T> getOidClass()
      • getVidClass

        Class<? extends VID_T> getVidClass()
      • 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.
      • getLocalInDegree

        int getLocalInDegree​(Vertex<VID_T> vertex)
      • getLocalOutDegree

        int getLocalOutDegree​(Vertex<VID_T> vertex)
      • 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
      • setData

        void setData​(Vertex<VID_T> vertex,
                     VDATA_T vdata)
        Update vertex data with a new value.
        Parameters:
        vertex - querying vertex.
        vdata - new vertex data.