I
- Vertex idM
- Message datapublic interface MessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
Modifier and Type | Method and Description |
---|---|
void |
addMessage(I vertexId,
M message)
Adds a message for a particular vertex
The method is used by InternalMessageStore to send local messages; for
the general case, use a more efficient addPartitionMessages
|
void |
addPartitionMessages(int partitionId,
VertexIdMessages<I,M> messages)
Adds messages for partition
|
void |
clearAll()
Clears all resources used by this store.
|
void |
clearPartition(int partitionId)
Clears messages for a partition.
|
void |
clearVertexMessages(I vertexId)
Clears messages for a vertex.
|
void |
finalizeStore()
Called before start of computation in bspworker
Since it is run from a single thread while the store is not being
accessed by any other thread - this is ensured to be thread-safe
|
Iterable<I> |
getPartitionDestinationVertices(int partitionId)
Gets vertex ids from selected partition which we have messages for
|
Iterable<M> |
getVertexMessages(I vertexId)
Gets messages for a vertex.
|
boolean |
hasMessagesForPartition(int partitionId)
Check if we have messages for some partition
|
boolean |
hasMessagesForVertex(I vertexId)
Check if we have messages for some vertex
|
boolean |
isPointerListEncoding()
True if this message-store encodes messages as a list of long pointers
to compact serialized messages
|
void |
readFieldsForPartition(DataInput in,
int partitionId)
Deserialize messages for one partition
|
void |
writePartition(DataOutput out,
int partitionId)
Serialize messages for one partition.
|
boolean isPointerListEncoding()
Iterable<M> getVertexMessages(I vertexId)
vertexId
- Vertex id for which we want to get messagesvoid clearVertexMessages(I vertexId)
vertexId
- Vertex id for which we want to clear messagesvoid clearAll()
boolean hasMessagesForVertex(I vertexId)
vertexId
- Id of vertex which we want to checkboolean hasMessagesForPartition(int partitionId)
partitionId
- Id of partition which we want to checkvoid addPartitionMessages(int partitionId, VertexIdMessages<I,M> messages)
partitionId
- Id of partitionmessages
- Collection of vertex ids and messages we want to addvoid addMessage(I vertexId, M message) throws IOException
vertexId
- Id of target vertexmessage
- A message to sendIOException
void finalizeStore()
Iterable<I> getPartitionDestinationVertices(int partitionId)
partitionId
- Id of partitionvoid clearPartition(int partitionId)
partitionId
- Partition id for which we want to clear messagesvoid writePartition(DataOutput out, int partitionId) throws IOException
out
- DataOutput
to serialize this object intopartitionId
- Id of partitionIOException
void readFieldsForPartition(DataInput in, int partitionId) throws IOException
in
- DataInput
to deserialize this object
from.partitionId
- Id of partitionIOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.