public class LongDoubleMessageStore extends Object implements MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>
| Constructor and Description |
|---|
LongDoubleMessageStore(PartitionSplitInfo<org.apache.hadoop.io.LongWritable> partitionInfo,
MessageCombiner<? super org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable> messageCombiner)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(org.apache.hadoop.io.LongWritable vertexId,
org.apache.hadoop.io.DoubleWritable 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<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable> 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(org.apache.hadoop.io.LongWritable 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<org.apache.hadoop.io.LongWritable> |
getPartitionDestinationVertices(int partitionId)
Gets vertex ids from selected partition which we have messages for
|
Iterable<org.apache.hadoop.io.DoubleWritable> |
getVertexMessages(org.apache.hadoop.io.LongWritable vertexId)
Gets messages for a vertex.
|
boolean |
hasMessagesForPartition(int partitionId)
Check if we have messages for some partition
|
boolean |
hasMessagesForVertex(org.apache.hadoop.io.LongWritable 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.
|
public LongDoubleMessageStore(PartitionSplitInfo<org.apache.hadoop.io.LongWritable> partitionInfo, MessageCombiner<? super org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable> messageCombiner)
partitionInfo - Partition split infomessageCombiner - Message messageCombinerpublic boolean isPointerListEncoding()
MessageStoreisPointerListEncoding in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>public void addPartitionMessages(int partitionId,
VertexIdMessages<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable> messages)
MessageStoreaddPartitionMessages in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>partitionId - Id of partitionmessages - Collection of vertex ids and messages we want to addpublic void addMessage(org.apache.hadoop.io.LongWritable vertexId,
org.apache.hadoop.io.DoubleWritable message)
throws IOException
MessageStoreaddMessage in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>vertexId - Id of target vertexmessage - A message to sendIOExceptionpublic void finalizeStore()
MessageStorefinalizeStore in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>public void clearPartition(int partitionId)
MessageStoreclearPartition in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>partitionId - Partition id for which we want to clear messagespublic boolean hasMessagesForVertex(org.apache.hadoop.io.LongWritable vertexId)
MessageStorehasMessagesForVertex in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>vertexId - Id of vertex which we want to checkpublic boolean hasMessagesForPartition(int partitionId)
MessageStorehasMessagesForPartition in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>partitionId - Id of partition which we want to checkpublic Iterable<org.apache.hadoop.io.DoubleWritable> getVertexMessages(org.apache.hadoop.io.LongWritable vertexId)
MessageStoregetVertexMessages in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>vertexId - Vertex id for which we want to get messagespublic void clearVertexMessages(org.apache.hadoop.io.LongWritable vertexId)
MessageStoreclearVertexMessages in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>vertexId - Vertex id for which we want to clear messagespublic void clearAll()
MessageStoreclearAll in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>public Iterable<org.apache.hadoop.io.LongWritable> getPartitionDestinationVertices(int partitionId)
MessageStoregetPartitionDestinationVertices in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>partitionId - Id of partitionpublic void writePartition(DataOutput out, int partitionId) throws IOException
MessageStorewritePartition in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>out - DataOutput to serialize this object intopartitionId - Id of partitionIOExceptionpublic void readFieldsForPartition(DataInput in, int partitionId) throws IOException
MessageStorereadFieldsForPartition in interface MessageStore<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable>in - DataInput to deserialize this object
from.partitionId - Id of partitionIOExceptionCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.