I
- Vertex idM
- Message datapublic class OneMessagePerVertexStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> extends SimpleMessageStore<I,M,M>
SimpleMessageStore
where we have a single
message per vertex.
Used when MessageCombiner
is provided.config, map, messageValueFactory, partitionInfo
Constructor and Description |
---|
OneMessagePerVertexStore(MessageValueFactory<M> messageValueFactory,
PartitionSplitInfo<I> partitionInfo,
MessageCombiner<? super I,M> messageCombiner,
ImmutableClassesGiraphConfiguration<I,?,?> config) |
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
|
protected Iterable<M> |
getMessagesAsIterable(M message)
Get messages as an iterable from message storage
|
protected int |
getNumberOfMessagesIn(ConcurrentMap<I,M> partitionMap)
Get number of messages in partition map
|
boolean |
isPointerListEncoding()
True if this message-store encodes messages as a list of long pointers
to compact serialized messages
|
static <I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> |
newFactory(CentralizedServiceWorker<I,?,?> service,
ImmutableClassesGiraphConfiguration<I,?,?> config)
Create new factory for this message store
|
protected M |
readFieldsForMessages(DataInput in)
Read message storage from
DataInput |
protected void |
writeMessages(M messages,
DataOutput out)
Write message storage to
DataOutput |
clearAll, clearPartition, clearVertexMessages, finalizeStore, getOrCreatePartitionMap, getPartitionDestinationVertices, getPartitionId, getVertexMessages, hasMessagesForPartition, hasMessagesForVertex, readFieldsForPartition, writePartition
public OneMessagePerVertexStore(MessageValueFactory<M> messageValueFactory, PartitionSplitInfo<I> partitionInfo, MessageCombiner<? super I,M> messageCombiner, ImmutableClassesGiraphConfiguration<I,?,?> config)
messageValueFactory
- Message class held in the storepartitionInfo
- Partition split infomessageCombiner
- MessageCombiner for messagesconfig
- Hadoop configurationpublic boolean isPointerListEncoding()
MessageStore
public void addPartitionMessages(int partitionId, VertexIdMessages<I,M> messages)
MessageStore
partitionId
- Id of partitionmessages
- Collection of vertex ids and messages we want to addpublic void addMessage(I vertexId, M message) throws IOException
MessageStore
vertexId
- Id of target vertexmessage
- A message to sendIOException
protected Iterable<M> getMessagesAsIterable(M message)
SimpleMessageStore
getMessagesAsIterable
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
message
- Message storageprotected int getNumberOfMessagesIn(ConcurrentMap<I,M> partitionMap)
SimpleMessageStore
getNumberOfMessagesIn
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
partitionMap
- Partition map in which to count messagesprotected void writeMessages(M messages, DataOutput out) throws IOException
SimpleMessageStore
DataOutput
writeMessages
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
messages
- Message storageout
- Data outputIOException
protected M readFieldsForMessages(DataInput in) throws IOException
SimpleMessageStore
DataInput
readFieldsForMessages
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>
in
- Data inputIOException
public static <I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> MessageStoreFactory<I,M,MessageStore<I,M>> newFactory(CentralizedServiceWorker<I,?,?> service, ImmutableClassesGiraphConfiguration<I,?,?> config)
I
- Vertex idM
- Message dataservice
- Worker serviceconfig
- Hadoop configurationCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.