I - Vertex idV - Vertex dataE - Edge datapublic class DiskBackedEdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends DiskBackedDataStore<VertexIdEdges<I,E>> implements EdgeStore<I,V,E>
hasPartitionDataOnFile, MINIMUM_BUFFER_SIZE_TO_FLUSH, oocEngine| Constructor and Description |
|---|
DiskBackedEdgeStore(EdgeStore<I,V,E> edgeStore,
ImmutableClassesGiraphConfiguration<I,V,E> conf,
OutOfCoreEngine oocEngine)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEntryToInMemoryPartitionData(int partitionId,
VertexIdEdges<I,E> edges)
Adds a single entry for a given partition to the in-memory data store.
|
void |
addPartitionEdges(int partitionId,
VertexIdEdges<I,E> edges)
Add edges belonging to a given partition on this worker.
|
protected int |
entrySerializedSize(VertexIdEdges<I,E> edges)
Gets the size of a given entry in bytes.
|
boolean |
hasEdgesForPartition(int partitionId)
Check if edge store has edge for a given partition
|
protected long |
loadInMemoryPartitionData(int partitionId,
int ioThreadId,
DataIndex index)
Loads data of a partition into data store.
|
long |
loadPartitionData(int partitionId)
Loads and assembles all data for a given partition, and put it into the
data store.
|
void |
moveEdgesToVertices()
Move all edges from temporary storage to their source vertices.
|
long |
offloadBuffers(int partitionId)
Offloads raw data buffers of a given partition to disk, and returns the
number of bytes offloaded from memory to disk.
|
protected long |
offloadInMemoryPartitionData(int partitionId,
int ioThreadId,
DataIndex index)
Offloads data of a partition in data store to disk.
|
long |
offloadPartitionData(int partitionId)
Offloads partition data of a given partition in the data store to disk, and
returns the number of bytes offloaded from memory to disk.
|
protected VertexIdEdges<I,E> |
readNextEntry(DataInput in)
Reads the next available raw entry from a given input stream.
|
void |
readPartitionEdgeStore(int partitionId,
DataInput input)
Serialize the edges of a given partition, and adds it to the partition
store (assumes that the edge store does not have any edge from the
partition already).
|
protected void |
writeEntry(VertexIdEdges<I,E> edges,
DataOutput out)
Writes a single raw entry to a given output stream.
|
void |
writePartitionEdgeStore(int partitionId,
DataOutput output)
Deserialize the edges of a given partition, and removes the associated data
from the store.
|
addEntry, getCandidateBuffersToOffload, loadPartitionDataProxy, offloadBuffersProxy, offloadPartitionDataProxypublic DiskBackedEdgeStore(EdgeStore<I,V,E> edgeStore, ImmutableClassesGiraphConfiguration<I,V,E> conf, OutOfCoreEngine oocEngine)
edgeStore - In-memory edge store for which out-of-core edge store
would be a wrapperconf - ConfigurationoocEngine - Out-of-core enginepublic void addPartitionEdges(int partitionId,
VertexIdEdges<I,E> edges)
EdgeStoreaddPartitionEdges in interface EdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>partitionId - Partition id for the incoming edges.edges - Incoming edgespublic void moveEdgesToVertices()
EdgeStoremoveEdgesToVertices in interface EdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public void writePartitionEdgeStore(int partitionId,
DataOutput output)
throws IOException
EdgeStorewritePartitionEdgeStore in interface EdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>partitionId - Id of partition to deserializeoutput - Output to write the edge store toIOExceptionpublic void readPartitionEdgeStore(int partitionId,
DataInput input)
throws IOException
EdgeStorereadPartitionEdgeStore in interface EdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>partitionId - Id of partition to serializeinput - Input to read the partition fromIOExceptionpublic boolean hasEdgesForPartition(int partitionId)
EdgeStorehasEdgesForPartition in interface EdgeStore<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>partitionId - Id of partitionpublic long loadPartitionData(int partitionId)
throws IOException
DiskBackedDataStoreloadPartitionData in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to load and assemble all data forIOExceptionpublic long offloadPartitionData(int partitionId)
throws IOException
DiskBackedDataStoreoffloadPartitionData in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to offload its dataIOExceptionpublic long offloadBuffers(int partitionId)
throws IOException
DiskBackedDataStoreoffloadBuffers in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to offload its raw data buffersIOExceptionprotected void writeEntry(VertexIdEdges<I,E> edges, DataOutput out) throws IOException
DiskBackedDataStorewriteEntry in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>edges - entry to write to outputout - output stream to write the entry toIOExceptionprotected VertexIdEdges<I,E> readNextEntry(DataInput in) throws IOException
DiskBackedDataStorereadNextEntry in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>in - input stream to read the entry fromIOExceptionprotected long loadInMemoryPartitionData(int partitionId,
int ioThreadId,
DataIndex index)
throws IOException
DiskBackedDataStoreloadInMemoryPartitionData in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to load its dataioThreadId - id of the IO thread performing the loadindex - data index chain for the data to loadIOExceptionprotected long offloadInMemoryPartitionData(int partitionId,
int ioThreadId,
DataIndex index)
throws IOException
DiskBackedDataStoreoffloadInMemoryPartitionData in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to offload to diskioThreadId - id of the IO thread performing the offloadindex - data index chain for the data to offloadIOExceptionprotected int entrySerializedSize(VertexIdEdges<I,E> edges)
DiskBackedDataStoreentrySerializedSize in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>edges - input entry to find its sizeprotected void addEntryToInMemoryPartitionData(int partitionId,
VertexIdEdges<I,E> edges)
DiskBackedDataStoreaddEntryToInMemoryPartitionData in class DiskBackedDataStore<VertexIdEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>>partitionId - id of the partition to add the data toedges - input entry to add to the data storeCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.