M
- message typepublic class LongPointerListPerVertexStore<M extends org.apache.hadoop.io.Writable> extends LongAbstractListStore<M,it.unimi.dsi.fastutil.longs.LongArrayList> implements MessageStore<org.apache.hadoop.io.LongWritable,M>
ExtendedByteArrayOutputBuffer
and stores long pointers that point to serialized messagesconfig, map, messageValueFactory, partitionInfo
Constructor and Description |
---|
LongPointerListPerVertexStore(MessageValueFactory<M> messageValueFactory,
PartitionSplitInfo<org.apache.hadoop.io.LongWritable> partitionInfo,
ImmutableClassesGiraphConfiguration<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable> config)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(org.apache.hadoop.io.LongWritable 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<org.apache.hadoop.io.LongWritable,M> messages)
Adds messages for partition
|
protected it.unimi.dsi.fastutil.longs.LongArrayList |
createList()
Create an instance of L
|
Iterable<M> |
getVertexMessages(org.apache.hadoop.io.LongWritable vertexId)
Gets messages for a 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.
|
finalizeStore, getList, hasMessagesForVertex
clearAll, clearPartition, clearVertexMessages, getPartitionDestinationVertices, getPartitionMap, hasMessagesForPartition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearAll, clearPartition, clearVertexMessages, finalizeStore, getPartitionDestinationVertices, hasMessagesForPartition, hasMessagesForVertex
public LongPointerListPerVertexStore(MessageValueFactory<M> messageValueFactory, PartitionSplitInfo<org.apache.hadoop.io.LongWritable> partitionInfo, ImmutableClassesGiraphConfiguration<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable> config)
messageValueFactory
- Factory for creating message valuespartitionInfo
- Partition split infoconfig
- Hadoop configurationpublic boolean isPointerListEncoding()
MessageStore
isPointerListEncoding
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
protected it.unimi.dsi.fastutil.longs.LongArrayList createList()
LongAbstractListStore
createList
in class LongAbstractListStore<M extends org.apache.hadoop.io.Writable,it.unimi.dsi.fastutil.longs.LongArrayList>
public void addPartitionMessages(int partitionId, VertexIdMessages<org.apache.hadoop.io.LongWritable,M> messages)
MessageStore
addPartitionMessages
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
partitionId
- Id of partitionmessages
- Collection of vertex ids and messages we want to addpublic void addMessage(org.apache.hadoop.io.LongWritable vertexId, M message) throws IOException
MessageStore
addMessage
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
vertexId
- Id of target vertexmessage
- A message to sendIOException
public Iterable<M> getVertexMessages(org.apache.hadoop.io.LongWritable vertexId)
MessageStore
getVertexMessages
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
vertexId
- Vertex id for which we want to get messagespublic void writePartition(DataOutput out, int partitionId) throws IOException
MessageStore
writePartition
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
out
- DataOutput
to serialize this object intopartitionId
- Id of partitionIOException
public void readFieldsForPartition(DataInput in, int partitionId) throws IOException
MessageStore
readFieldsForPartition
in interface MessageStore<org.apache.hadoop.io.LongWritable,M extends org.apache.hadoop.io.Writable>
in
- DataInput
to deserialize this object
from.partitionId
- Id of partitionIOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.