I
- Vertex idM
- Message datapublic class ByteArrayMessagesPerVertexStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> extends SimpleMessageStore<I,M,DataInputOutput>
SimpleMessageStore
where multiple messages are
stored per vertex as byte backed datastructures.
Used when there is no combiner provided.Modifier and Type | Class and Description |
---|---|
static class |
ByteArrayMessagesPerVertexStore.Factory<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
Factory for
ByteArrayMessagesPerVertexStore |
config, map, messageValueFactory, partitionInfo
Constructor and Description |
---|
ByteArrayMessagesPerVertexStore(MessageValueFactory<M> messageValueFactory,
PartitionSplitInfo<I> partitionInfo,
ImmutableClassesGiraphConfiguration<I,?,?> config)
Constructor
|
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(DataInputOutput dataInputOutput)
Get messages as an iterable from message storage
|
protected int |
getNumberOfMessagesIn(ConcurrentMap<I,DataInputOutput> 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 DataInputOutput |
readFieldsForMessages(DataInput in)
Read message storage from
DataInput |
protected void |
writeMessages(DataInputOutput dataInputOutput,
DataOutput out)
Write message storage to
DataOutput |
clearAll, clearPartition, clearVertexMessages, finalizeStore, getOrCreatePartitionMap, getPartitionDestinationVertices, getPartitionId, getVertexMessages, hasMessagesForPartition, hasMessagesForVertex, readFieldsForPartition, writePartition
public ByteArrayMessagesPerVertexStore(MessageValueFactory<M> messageValueFactory, PartitionSplitInfo<I> partitionInfo, ImmutableClassesGiraphConfiguration<I,?,?> config)
messageValueFactory
- Message class held in the storepartitionInfo
- Partition split infoconfig
- 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(DataInputOutput dataInputOutput)
SimpleMessageStore
getMessagesAsIterable
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,DataInputOutput>
dataInputOutput
- Message storageprotected int getNumberOfMessagesIn(ConcurrentMap<I,DataInputOutput> partitionMap)
SimpleMessageStore
getNumberOfMessagesIn
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,DataInputOutput>
partitionMap
- Partition map in which to count messagesprotected void writeMessages(DataInputOutput dataInputOutput, DataOutput out) throws IOException
SimpleMessageStore
DataOutput
writeMessages
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,DataInputOutput>
dataInputOutput
- Message storageout
- Data outputIOException
protected DataInputOutput 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,DataInputOutput>
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.