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, offloadPartitionDataProxy
public 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)
EdgeStore
addPartitionEdges
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()
EdgeStore
moveEdgesToVertices
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
EdgeStore
writePartitionEdgeStore
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 toIOException
public void readPartitionEdgeStore(int partitionId, DataInput input) throws IOException
EdgeStore
readPartitionEdgeStore
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 fromIOException
public boolean hasEdgesForPartition(int partitionId)
EdgeStore
hasEdgesForPartition
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
DiskBackedDataStore
loadPartitionData
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 forIOException
public long offloadPartitionData(int partitionId) throws IOException
DiskBackedDataStore
offloadPartitionData
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 dataIOException
public long offloadBuffers(int partitionId) throws IOException
DiskBackedDataStore
offloadBuffers
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 buffersIOException
protected void writeEntry(VertexIdEdges<I,E> edges, DataOutput out) throws IOException
DiskBackedDataStore
writeEntry
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 toIOException
protected VertexIdEdges<I,E> readNextEntry(DataInput in) throws IOException
DiskBackedDataStore
readNextEntry
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 fromIOException
protected long loadInMemoryPartitionData(int partitionId, int ioThreadId, DataIndex index) throws IOException
DiskBackedDataStore
loadInMemoryPartitionData
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 loadIOException
protected long offloadInMemoryPartitionData(int partitionId, int ioThreadId, DataIndex index) throws IOException
DiskBackedDataStore
offloadInMemoryPartitionData
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 offloadIOException
protected int entrySerializedSize(VertexIdEdges<I,E> edges)
DiskBackedDataStore
entrySerializedSize
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)
DiskBackedDataStore
addEntryToInMemoryPartitionData
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.