I - Vertex idM - Message datapublic class SendMessageCache<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> extends SendVertexIdDataCache<I,M,VertexIdMessages<I,M>>
| Modifier and Type | Class and Description |
|---|---|
static class |
SendMessageCache.TargetVertexIdIterator<I extends org.apache.hadoop.io.WritableComparable>
An iterator wrapper on edges to return
target vertex ids.
|
| Modifier and Type | Field and Description |
|---|---|
protected NettyWorkerClientRequestProcessor<I,?,?> |
clientProcessor
NettyWorkerClientRequestProcessor for message sending
|
protected int |
maxMessagesSizePerWorker
Max message size sent to a worker
|
protected MessageValueFactory<M> |
messageValueFactory
Cached message value factory
|
protected long |
totalMsgBytesSentInSuperstep
Message bytes sent during the last superstep
|
protected long |
totalMsgsSentInSuperstep
Messages sent during the last superstep
|
| Constructor and Description |
|---|
SendMessageCache(ImmutableClassesGiraphConfiguration conf,
CentralizedServiceWorker<?,?,?> serviceWorker,
NettyWorkerClientRequestProcessor<I,?,?> processor,
int maxMsgSize)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
addMessage(WorkerInfo workerInfo,
int partitionId,
byte[] serializedId,
int idSerializerPos,
M message)
Add a message to the cache with serialized ids.
|
int |
addMessage(WorkerInfo workerInfo,
int partitionId,
I destVertexId,
M message)
Add a message to the cache.
|
VertexIdMessages<I,M> |
createVertexIdData()
Create a new
VertexIdData specialized for the use case. |
void |
flush()
Flush the rest of the messages to the workers.
|
protected PairList<Integer,VertexIdMessages<I,M>> |
removeWorkerMessages(WorkerInfo workerInfo)
Gets the messages for a worker and removes it from the cache.
|
long |
resetMessageBytesCount()
Reset the message bytes count per superstep.
|
long |
resetMessageCount()
Reset the message count per superstep.
|
void |
sendMessageRequest(I destVertexId,
M message)
Send a message to a target vertex id.
|
void |
sendMessageToAllRequest(Iterator<I> vertexIdIterator,
M message)
Send message to the target ids in the iterator
|
void |
sendMessageToAllRequest(Vertex<I,?,?> vertex,
M message)
Send message to all its neighbors
|
addData, addDatagetConf, getData, getInitialBufferSize, getNumWorkers, getSendWorkerInitialBufferSize, getServiceWorker, getWorkerPartitions, incrDataSize, removeAllData, removeWorkerData, setDataprotected long totalMsgsSentInSuperstep
protected long totalMsgBytesSentInSuperstep
protected final int maxMessagesSizePerWorker
protected final NettyWorkerClientRequestProcessor<I extends org.apache.hadoop.io.WritableComparable,?,?> clientProcessor
protected MessageValueFactory<M extends org.apache.hadoop.io.Writable> messageValueFactory
public SendMessageCache(ImmutableClassesGiraphConfiguration conf, CentralizedServiceWorker<?,?,?> serviceWorker, NettyWorkerClientRequestProcessor<I,?,?> processor, int maxMsgSize)
conf - Giraph configurationserviceWorker - Service workerprocessor - NettyWorkerClientRequestProcessormaxMsgSize - Max message size sent to a workerpublic VertexIdMessages<I,M> createVertexIdData()
SendVertexIdDataCacheVertexIdData specialized for the use case.createVertexIdData in class SendVertexIdDataCache<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,VertexIdMessages<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>>VertexIdDatapublic int addMessage(WorkerInfo workerInfo, int partitionId, I destVertexId, M message)
workerInfo - the remote worker destinationpartitionId - the remote Partition this message belongs todestVertexId - vertex id that is ultimate destinationmessage - Message to send to remote workerprotected int addMessage(WorkerInfo workerInfo, int partitionId, byte[] serializedId, int idSerializerPos, M message)
workerInfo - The remote worker destinationpartitionId - The remote Partition this message belongs toserializedId - Serialized vertex id that is ultimate destinationidSerializerPos - The end position of serialized id in the byte arraymessage - Message to send to remote workerprotected PairList<Integer,VertexIdMessages<I,M>> removeWorkerMessages(WorkerInfo workerInfo)
workerInfo - the address of the worker who owns the data
partitions that are receiving the messagespublic void sendMessageRequest(I destVertexId, M message)
destVertexId - Target vertex idmessage - The message sent to the targetpublic void sendMessageToAllRequest(Vertex<I,?,?> vertex, M message)
vertex - The source vertexmessage - The message sent to a workerpublic void sendMessageToAllRequest(Iterator<I> vertexIdIterator, M message)
vertexIdIterator - The iterator of target vertex idsmessage - The message sent to a workerpublic void flush()
public long resetMessageCount()
public long resetMessageBytesCount()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.