I
- vertexId typeM
- message typepublic class PointerListPerVertexStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> extends AbstractListPerVertexStore<I,M,it.unimi.dsi.fastutil.longs.LongArrayList>
SimpleMessageStore
where multiple messages are
stored as a list of long pointers to extended data output objects
Used when there is no combiner provided.config, map, messageValueFactory, partitionInfo
Constructor and Description |
---|
PointerListPerVertexStore(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 it.unimi.dsi.fastutil.longs.LongArrayList |
createList()
Create an instance of L
|
Iterable<M> |
getMessagesAsIterable(it.unimi.dsi.fastutil.longs.LongArrayList pointers)
Get messages as an iterable from message storage
|
protected int |
getNumberOfMessagesIn(ConcurrentMap<I,it.unimi.dsi.fastutil.longs.LongArrayList> 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
|
protected it.unimi.dsi.fastutil.longs.LongArrayList |
readFieldsForMessages(DataInput in)
Read message storage from
DataInput |
protected void |
writeMessages(it.unimi.dsi.fastutil.longs.LongArrayList messages,
DataOutput out)
Write message storage to
DataOutput |
getOrCreateList, getOrCreateList, getVertexMessages
clearAll, clearPartition, clearVertexMessages, finalizeStore, getOrCreatePartitionMap, getPartitionDestinationVertices, getPartitionId, hasMessagesForPartition, hasMessagesForVertex, readFieldsForPartition, writePartition
public PointerListPerVertexStore(MessageValueFactory<M> messageValueFactory, PartitionSplitInfo<I> partitionInfo, ImmutableClassesGiraphConfiguration<I,?,?> config)
messageValueFactory
- Message class held in the storepartitionInfo
- Partition split infoconfig
- Hadoop configurationpublic boolean isPointerListEncoding()
MessageStore
protected it.unimi.dsi.fastutil.longs.LongArrayList createList()
AbstractListPerVertexStore
createList
in class AbstractListPerVertexStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,it.unimi.dsi.fastutil.longs.LongArrayList>
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
public Iterable<M> getMessagesAsIterable(it.unimi.dsi.fastutil.longs.LongArrayList pointers)
getMessagesAsIterable
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,it.unimi.dsi.fastutil.longs.LongArrayList>
pointers
- list of pointers to messagesprotected int getNumberOfMessagesIn(ConcurrentMap<I,it.unimi.dsi.fastutil.longs.LongArrayList> partitionMap)
SimpleMessageStore
getNumberOfMessagesIn
in class SimpleMessageStore<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable,it.unimi.dsi.fastutil.longs.LongArrayList>
partitionMap
- Partition map in which to count messagesprotected void writeMessages(it.unimi.dsi.fastutil.longs.LongArrayList 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,it.unimi.dsi.fastutil.longs.LongArrayList>
messages
- Message storageout
- Data outputIOException
protected it.unimi.dsi.fastutil.longs.LongArrayList 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,it.unimi.dsi.fastutil.longs.LongArrayList>
in
- Data inputIOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.