Interface ParallelMessageManager

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      @com.alibaba.fastffi.FFINameAlias("GetMessageInBuffer") boolean getMessageInBuffer​(MessageInBuffer buf)
      Retrieve a message archive.
      void initChannels​(int channel_num)
      Init the message manager which number of possible channels.
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T>
      void
      parallelProcess​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, int threadNum, ExecutorService executor, Supplier<MSG_T> msgSupplier, BiConsumer<Vertex<VID_T>,​MSG_T> consumer)
      Parallel processing the messages received from last super step.
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T>
      boolean
      sendMsgThroughEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, Vertex<VID_T> vertex, MSG_T msg, int channelId)  
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughEdgesArrowProjected​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through incoming and outgoing edges.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughEdgesImmutable​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through incoming and outgoing edges.
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T>
      boolean
      sendMsgThroughIEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, Vertex<VID_T> vertex, MSG_T msg, int channelId)  
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughIEdgesArrowProjected​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through incoming edges.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughIEdgesImmutable​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through incoming edges.
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T>
      boolean
      sendMsgThroughOEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, Vertex<VID_T> vertex, MSG_T msg, int channelId)  
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughOEdgesArrowProjected​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through outgoing edges.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      sendMsgThroughOEdgesImmutable​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send the a vertex's data to other fragment through outgoing edges.
      <MSG_T> void sendToFragment​(int dstFid, MSG_T msg, int channelId)  
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T>
      boolean
      syncStateOnOuterVertex​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, Vertex<VID_T> vertex, MSG_T msg, int channelId)  
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      syncStateOnOuterVertexArrowProjected​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send a msg to the fragment where the querying outer vertex is an inner vertexin another fragment.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​UNUSED_T>
      void
      syncStateOnOuterVertexArrowProjectedNoMsg​(FRAG_T frag, Vertex<VID_T> vertex, int channel_id, UNUSED_T vdata)
      SyncState on outer vertex without message, used in bfs etc.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T>
      void
      syncStateOnOuterVertexImmutable​(FRAG_T frag, Vertex<VID_T> vertex, MSG_T msg, int channel_id, UNUSED_T unused)
      Send a msg to the fragment where the querying outer vertex is an inner vertexin another fragment.
      <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​UNUSED_T>
      void
      syncStateOnOuterVertexImmutableNoMsg​(FRAG_T frag, Vertex<VID_T> vertex, int channel_id, UNUSED_T vdata)
      SyncState on outer vertex without message, used in bfs etc.
      default <OID_T,​VID_T,​VDATA_T,​EDATA_T>
      boolean
      syncStateOnOuterVertexNoMsg​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag, Vertex<VID_T> vertex, int channelId)  
      • Methods inherited from interface com.alibaba.fastffi.FFIPointer

        getAddress
    • Method Detail

      • syncStateOnOuterVertex

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T> boolean syncStateOnOuterVertex​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                           Vertex<VID_T> vertex,
                                                                                                           MSG_T msg,
                                                                                                           int channelId)
      • syncStateOnOuterVertexNoMsg

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T> boolean syncStateOnOuterVertexNoMsg​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                    Vertex<VID_T> vertex,
                                                                                                    int channelId)
      • sendMsgThroughOEdges

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T> boolean sendMsgThroughOEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                         Vertex<VID_T> vertex,
                                                                                                         MSG_T msg,
                                                                                                         int channelId)
      • sendMsgThroughEdges

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T> boolean sendMsgThroughEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                        Vertex<VID_T> vertex,
                                                                                                        MSG_T msg,
                                                                                                        int channelId)
      • sendMsgThroughIEdges

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T> boolean sendMsgThroughIEdges​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                         Vertex<VID_T> vertex,
                                                                                                         MSG_T msg,
                                                                                                         int channelId)
      • initChannels

        void initChannels​(int channel_num)
        Init the message manager which number of possible channels. Each channel will swap messages in parallel.
        Parameters:
        channel_num - number of channels.
      • getMessageInBuffer

        @com.alibaba.fastffi.FFINameAlias("GetMessageInBuffer") boolean getMessageInBuffer​(MessageInBuffer buf)
        Retrieve a message archive.
        Parameters:
        buf - place to store the archive.
        Returns:
        true if got one.
      • sendToFragment

        <MSG_T> void sendToFragment​(int dstFid,
                                    MSG_T msg,
                                    int channelId)
      • syncStateOnOuterVertexImmutable

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void syncStateOnOuterVertexImmutable​(FRAG_T frag,
                                                                                                                                                                                                                     Vertex<VID_T> vertex,
                                                                                                                                                                                                                     MSG_T msg,
                                                                                                                                                                                                                     int channel_id,
                                                                                                                                                                                                                     UNUSED_T unused)
        Send a msg to the fragment where the querying outer vertex is an inner vertexin another fragment.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ImmutableEdgeCutFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel id.
      • syncStateOnOuterVertexArrowProjected

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void syncStateOnOuterVertexArrowProjected​(FRAG_T frag,
                                                                                                                                                                                                                        Vertex<VID_T> vertex,
                                                                                                                                                                                                                        MSG_T msg,
                                                                                                                                                                                                                        int channel_id,
                                                                                                                                                                                                                        UNUSED_T unused)
        Send a msg to the fragment where the querying outer vertex is an inner vertexin another fragment.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ArrowProjectedFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel id.
      • syncStateOnOuterVertexImmutableNoMsg

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​UNUSED_T> void syncStateOnOuterVertexImmutableNoMsg​(FRAG_T frag,
                                                                                                                                                                                                              Vertex<VID_T> vertex,
                                                                                                                                                                                                              int channel_id,
                                                                                                                                                                                                              UNUSED_T vdata)
        SyncState on outer vertex without message, used in bfs etc.
        Parameters:
        frag - fragment.
        vertex - query vertex.
        channel_id - message channel id.
      • syncStateOnOuterVertexArrowProjectedNoMsg

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​UNUSED_T> void syncStateOnOuterVertexArrowProjectedNoMsg​(FRAG_T frag,
                                                                                                                                                                                                                 Vertex<VID_T> vertex,
                                                                                                                                                                                                                 int channel_id,
                                                                                                                                                                                                                 UNUSED_T vdata)
        SyncState on outer vertex without message, used in bfs etc.
        Parameters:
        frag - fragment.
        vertex - query vertex.
        channel_id - message channel id.
      • sendMsgThroughOEdgesImmutable

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughOEdgesImmutable​(FRAG_T frag,
                                                                                                                                                                                                                   Vertex<VID_T> vertex,
                                                                                                                                                                                                                   MSG_T msg,
                                                                                                                                                                                                                   int channel_id,
                                                                                                                                                                                                                   UNUSED_T unused)
        Send the a vertex's data to other fragment through outgoing edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ImmutableEdgeCutFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id
      • sendMsgThroughOEdgesArrowProjected

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughOEdgesArrowProjected​(FRAG_T frag,
                                                                                                                                                                                                                      Vertex<VID_T> vertex,
                                                                                                                                                                                                                      MSG_T msg,
                                                                                                                                                                                                                      int channel_id,
                                                                                                                                                                                                                      UNUSED_T unused)
        Send the a vertex's data to other fragment through outgoing edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ArrowProjectedFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id.
      • sendMsgThroughEdgesImmutable

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughEdgesImmutable​(FRAG_T frag,
                                                                                                                                                                                                                  Vertex<VID_T> vertex,
                                                                                                                                                                                                                  MSG_T msg,
                                                                                                                                                                                                                  int channel_id,
                                                                                                                                                                                                                  UNUSED_T unused)
        Send the a vertex's data to other fragment through incoming and outgoing edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ImmutableEdgecutFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id.
      • sendMsgThroughEdgesArrowProjected

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughEdgesArrowProjected​(FRAG_T frag,
                                                                                                                                                                                                                     Vertex<VID_T> vertex,
                                                                                                                                                                                                                     MSG_T msg,
                                                                                                                                                                                                                     int channel_id,
                                                                                                                                                                                                                     UNUSED_T unused)
        Send the a vertex's data to other fragment through incoming and outgoing edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ArrowProjectedFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id.
      • sendMsgThroughIEdgesImmutable

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ImmutableEdgecutFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughIEdgesImmutable​(FRAG_T frag,
                                                                                                                                                                                                                   Vertex<VID_T> vertex,
                                                                                                                                                                                                                   MSG_T msg,
                                                                                                                                                                                                                   int channel_id,
                                                                                                                                                                                                                   UNUSED_T unused)
        Send the a vertex's data to other fragment through incoming edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ImmutableEdgecutFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id.
      • sendMsgThroughIEdgesArrowProjected

        <OID_T,​VID_T,​VDATA_T,​EDATA_T,​FRAG_T extends ArrowProjectedFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T>,​MSG_T,​UNUSED_T> void sendMsgThroughIEdgesArrowProjected​(FRAG_T frag,
                                                                                                                                                                                                                      Vertex<VID_T> vertex,
                                                                                                                                                                                                                      MSG_T msg,
                                                                                                                                                                                                                      int channel_id,
                                                                                                                                                                                                                      UNUSED_T unused)
        Send the a vertex's data to other fragment through incoming edges.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - ArrowProjectedFragment.
        vertex - querying vertex.
        msg - msg to send.
        channel_id - channel_id.
      • parallelProcess

        default <OID_T,​VID_T,​VDATA_T,​EDATA_T,​MSG_T> void parallelProcess​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                                                                                                 int threadNum,
                                                                                                 ExecutorService executor,
                                                                                                 Supplier<MSG_T> msgSupplier,
                                                                                                 BiConsumer<Vertex<VID_T>,​MSG_T> consumer)
        Parallel processing the messages received from last super step. The user just need to provide a lamba consumer.
        Type Parameters:
        MSG_T - message type.
        Parameters:
        frag - fragment.
        threadNum - number of threads to use.
        executor - thread pool executor.
        msgSupplier - a producer function creating a msg instance.
        consumer - lambda function.