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>
- java.lang.Object
-
- com.alibaba.graphscope.parallel.mm.impl.AbstractMessageManager<OID_T,VDATA_T,EDATA_T,IN_MSG_T,OUT_MSG_T,GS_VID_T,GS_OID_T>
-
- com.alibaba.graphscope.parallel.mm.impl.GiraphNettyMessageManager<OID_T,VDATA_T,EDATA_T,IN_MSG_T,OUT_MSG_T,GS_VID_T,GS_OID_T>
-
- Type Parameters:
OID_T- original idVDATA_T- vertex dataEDATA_T- edge dataIN_MSG_T- incoming msg typeOUT_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.
-
-
Field Summary
-
Fields inherited from class com.alibaba.graphscope.parallel.mm.impl.AbstractMessageManager
currentIncomingMessageStore, fragId, fragment, fragNum, grapeMessager, grapeVertex, nextIncomingMessageStore
-
-
Constructor Summary
Constructors Constructor Description GiraphNettyMessageManager(IFragment fragment, NetworkMap networkMap, DefaultMessageManager mm, ImmutableClassesGiraphConfiguration<OID_T,VDATA_T,EDATA_T> conf, FFICommunicator communicator)The constructor is the preApplication.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishMessageSending()Make sure all messages has been sent.voidinitNetty()voidpostApplication()voidpostSuperstep()voidpreSuperstep()voidreceiveMessages()Called by our framework, to deserialize the messages from c++ to java.voidsendMessage(OID_T dstOid, OUT_MSG_T message)Send one message to dstOid.voidsendMessageToAllEdges(org.apache.giraph.graph.Vertex<OID_T,VDATA_T,EDATA_T> vertex, OUT_MSG_T message)Send msg to all neighbors of vertex.-
Methods inherited from class com.alibaba.graphscope.parallel.mm.impl.AbstractMessageManager
anyMessageReceived, checkLid, forceContinue, getCommunicator, getConf, getFragment, getMessages, messageAvailable
-
-
-
-
Constructor Detail
-
GiraphNettyMessageManager
public GiraphNettyMessageManager(IFragment fragment, NetworkMap networkMap, DefaultMessageManager mm, ImmutableClassesGiraphConfiguration<OID_T,VDATA_T,EDATA_T> conf, FFICommunicator communicator)
The constructor is the preApplication.- Parameters:
fragment- fragment to usenetworkMap- network mapconf- configuration
-
-
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 vertexmessage- 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()
-
-