Class GiraphNettyMessageManager<OID_T extends org.apache.hadoop.io.WritableComparable,​VDATA_T extends org.apache.hadoop.io.Writable,​EDATA_T extends org.apache.hadoop.io.Writable,​IN_MSG_T extends org.apache.hadoop.io.Writable,​OUT_MSG_T extends org.apache.hadoop.io.Writable,​GS_VID_T,​GS_OID_T>

  • Type Parameters:
    OID_T - original id
    VDATA_T - vertex data
    EDATA_T - edge data
    IN_MSG_T - incoming msg type
    OUT_MSG_T - outgoing msg type
    All Implemented Interfaces:
    GiraphMessageManager<OID_T,​VDATA_T,​EDATA_T,​IN_MSG_T,​OUT_MSG_T,​GS_VID_T,​GS_OID_T>

    public class GiraphNettyMessageManager<OID_T extends org.apache.hadoop.io.WritableComparable,​VDATA_T extends org.apache.hadoop.io.Writable,​EDATA_T extends org.apache.hadoop.io.Writable,​IN_MSG_T extends org.apache.hadoop.io.Writable,​OUT_MSG_T extends org.apache.hadoop.io.Writable,​GS_VID_T,​GS_OID_T>
    extends AbstractMessageManager<OID_T,​VDATA_T,​EDATA_T,​IN_MSG_T,​OUT_MSG_T,​GS_VID_T,​GS_OID_T>
    Giraph message manager relies on netty for ipc communication.

    One netty base message manager has a netty client and a netty server. Netty Client connect to all other netty server, and netty server is connected by other netty clients.

    Has similar role with WorkerClientRequestProcessor in Giraph.

    • Method Detail

      • initNetty

        public void initNetty()
      • receiveMessages

        public void receiveMessages()
        Called by our framework, to deserialize the messages from c++ to java. Must be called before getMessages
      • sendMessage

        public void sendMessage​(OID_T dstOid,
                                OUT_MSG_T message)
        Send one message to dstOid.
        Parameters:
        dstOid - vertex to receive this message.
        message - message.
      • sendMessageToAllEdges

        public void sendMessageToAllEdges​(org.apache.giraph.graph.Vertex<OID_T,​VDATA_T,​EDATA_T> vertex,
                                          OUT_MSG_T message)
        Send msg to all neighbors of vertex.
        Parameters:
        vertex - querying vertex
        message - message to send.
      • finishMessageSending

        public void finishMessageSending()
        Make sure all messages has been sent.
      • preSuperstep

        public void preSuperstep()
      • postSuperstep

        public void postSuperstep()
      • postApplication

        public void postApplication()