I
- Vertex idM
- Message datapublic class ByteArrayVertexIdMessages<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable> extends ByteArrayVertexIdData<I,M> implements VertexIdMessages<I,M>
extendedDataOutput
Constructor and Description |
---|
ByteArrayVertexIdMessages(MessageValueFactory<M> messageValueFactory)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] serializedId,
int idPos,
M message)
Add a serialized vertex id and data.
|
void |
add(I vertexId,
M message)
Add a vertex id and data pair to the collection.
|
M |
createData()
Create a new data object.
|
ByteStructVertexIdMessageBytesIterator<I,M> |
getVertexIdMessageBytesIterator()
Get specialized iterator that will instantiate the vertex id and
message of this object.
|
ByteStructVertexIdMessageIterator<I,M> |
getVertexIdMessageIterator()
Get specialized iterator that will instiantiate the vertex id and
message of this object.
|
void |
initialize()
Initialize the inner state.
|
void |
initialize(int expectedSize)
Initialize the inner state, with a known size.
|
void |
readData(ExtendedDataInput in,
M message)
Read a data object's fields from an
ExtendedDataInput . |
void |
readFields(DataInput dataInput) |
void |
write(DataOutput dataOutput) |
void |
writeData(ExtendedDataOutput out,
M message)
Write a data object to an
ExtendedDataOutput . |
getByteArray
clear, getConf, getSerializedSize, getSize, getVertexIdDataIterator, isEmpty, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, getSerializedSize, getSize, getVertexIdDataIterator, isEmpty
getConf
setConf
public ByteArrayVertexIdMessages(MessageValueFactory<M> messageValueFactory)
messageValueFactory
- Class for messagespublic M createData()
VertexIdData
createData
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
public void writeData(ExtendedDataOutput out, M message) throws IOException
VertexIdData
ExtendedDataOutput
.writeData
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
out
- ExtendedDataOutput
message
- Data object to writeIOException
public void readData(ExtendedDataInput in, M message) throws IOException
VertexIdData
ExtendedDataInput
.readData
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
in
- ExtendedDataInput
message
- Data object to fill in-placeIOException
public void initialize()
VertexIdData
add()
is
called.initialize
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
initialize
in class AbstractVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
public void initialize(int expectedSize)
VertexIdData
add()
is called.initialize
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
initialize
in class AbstractVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
expectedSize
- Number of bytes to be expectedpublic ByteStructVertexIdMessageIterator<I,M> getVertexIdMessageIterator()
VertexIdMessages
getVertexIdMessageIterator
in interface VertexIdMessages<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
public void add(I vertexId, M message)
VertexIdData
add
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
add
in class AbstractVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
vertexId
- Vertex idmessage
- Datapublic void add(byte[] serializedId, int idPos, M message)
VertexIdData
add
in interface VertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
add
in class AbstractVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
serializedId
- The bye array which holds the serialized id.idPos
- The end position of the serialized id in the byte array.message
- Datapublic ByteStructVertexIdMessageBytesIterator<I,M> getVertexIdMessageBytesIterator()
VertexIdMessages
getVertexIdMessageBytesIterator
in interface VertexIdMessages<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
public void write(DataOutput dataOutput) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class ByteArrayVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
IOException
public void readFields(DataInput dataInput) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class ByteArrayVertexIdData<I extends org.apache.hadoop.io.WritableComparable,M extends org.apache.hadoop.io.Writable>
IOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.