Class DefaultMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
- java.lang.Object
-
- com.alibaba.graphscope.parallel.message.DefaultMessageStore<OID_T,MSG_T,GS_VID_T>
-
- All Implemented Interfaces:
MessageStore<OID_T,MSG_T,GS_VID_T>
public class DefaultMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T> extends Object implements MessageStore<OID_T,MSG_T,GS_VID_T>
-
-
Constructor Summary
Constructors Constructor Description DefaultMessageStore(IFragment<?,GS_VID_T,?,?> fragment, ImmutableClassesGiraphConfiguration<OID_T,?,?> conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGidMessage(GS_VID_T gid, MSG_T writable)
For messages bound with gid, first get lid.void
addGidMessages(Iterator<GS_VID_T> gids, Iterator<MSG_T> writables)
void
addLidMessage(GS_VID_T lid, MSG_T writable)
boolean
anyMessageReceived()
Check whether any messages received.void
clearAll()
void
digest(FFIByteVector vector)
For a bytestream provided by FFIByteVector, read from it and digest its content.void
digestByteBuffer(io.netty.buffer.ByteBuf buf, boolean fromSelf)
Iterable<MSG_T>
getMessages(GS_VID_T lid)
Iterable<MSG_T>
getMessages(Long lid)
boolean
messageAvailable(GS_VID_T lid)
Check for lid, any messages available.boolean
messageAvailable(Long lid)
void
swap(MessageStore<OID_T,MSG_T,GS_VID_T> other)
-
-
-
Constructor Detail
-
DefaultMessageStore
public DefaultMessageStore(IFragment<?,GS_VID_T,?,?> fragment, ImmutableClassesGiraphConfiguration<OID_T,?,?> conf)
-
-
Method Detail
-
addLidMessage
public void addLidMessage(GS_VID_T lid, MSG_T writable)
- Specified by:
addLidMessage
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
addGidMessages
public void addGidMessages(Iterator<GS_VID_T> gids, Iterator<MSG_T> writables)
- Specified by:
addGidMessages
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
addGidMessage
public void addGidMessage(GS_VID_T gid, MSG_T writable)
For messages bound with gid, first get lid.- Specified by:
addGidMessage
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
- Parameters:
gid
- global idwritable
- msg
-
swap
public void swap(MessageStore<OID_T,MSG_T,GS_VID_T> other)
- Specified by:
swap
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
clearAll
public void clearAll()
- Specified by:
clearAll
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
anyMessageReceived
public boolean anyMessageReceived()
Check whether any messages received.- Specified by:
anyMessageReceived
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
messageAvailable
public boolean messageAvailable(GS_VID_T lid)
Check for lid, any messages available.- Specified by:
messageAvailable
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
- Parameters:
lid
- lid.- Returns:
- true if has message
-
messageAvailable
public boolean messageAvailable(Long lid)
- Specified by:
messageAvailable
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
getMessages
public Iterable<MSG_T> getMessages(Long lid)
- Specified by:
getMessages
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
getMessages
public Iterable<MSG_T> getMessages(GS_VID_T lid)
- Specified by:
getMessages
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
digest
public void digest(FFIByteVector vector)
For a bytestream provided by FFIByteVector, read from it and digest its content.- Specified by:
digest
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
- Parameters:
vector
-
-
digestByteBuffer
public void digestByteBuffer(io.netty.buffer.ByteBuf buf, boolean fromSelf)
- Specified by:
digestByteBuffer
in interfaceMessageStore<OID_T extends org.apache.hadoop.io.WritableComparable,MSG_T extends org.apache.hadoop.io.Writable,GS_VID_T>
-
-