public class LocalDiskDataAccessor extends Object implements OutOfCoreDataAccessor
OutOfCoreDataAccessor.DataInputWrapper, OutOfCoreDataAccessor.DataOutputWrapper
Modifier and Type | Field and Description |
---|---|
static IntConfOption |
OOC_DISK_BUFFER_SIZE
Size of the buffer used for (de)serializing data when reading/writing
from/to disk
|
Constructor and Description |
---|
LocalDiskDataAccessor(ImmutableClassesGiraphConfiguration<?,?,?> conf)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
dataExist(int threadId,
DataIndex index)
Whether the data for the given thread and index chain exists?
|
int |
getNumAccessorThreads() |
void |
initialize()
Initialize the DAO
|
OutOfCoreDataAccessor.DataInputWrapper |
prepareInput(int threadId,
DataIndex index)
Prepare a wrapper containing
DataInput representation for a
given thread involved in persistence for a given index chain for data. |
OutOfCoreDataAccessor.DataOutputWrapper |
prepareOutput(int threadId,
DataIndex index,
boolean shouldAppend)
Prepare a wrapper containing
DataOutput representation for a
given thread involved in persistence for a given index chain for data. |
void |
shutdown()
Shut down the DAO
|
public static final IntConfOption OOC_DISK_BUFFER_SIZE
public LocalDiskDataAccessor(ImmutableClassesGiraphConfiguration<?,?,?> conf)
conf
- Configurationpublic void initialize()
OutOfCoreDataAccessor
initialize
in interface OutOfCoreDataAccessor
public void shutdown()
OutOfCoreDataAccessor
shutdown
in interface OutOfCoreDataAccessor
public int getNumAccessorThreads()
getNumAccessorThreads
in interface OutOfCoreDataAccessor
public OutOfCoreDataAccessor.DataInputWrapper prepareInput(int threadId, DataIndex index) throws IOException
OutOfCoreDataAccessor
DataInput
representation for a
given thread involved in persistence for a given index chain for data.prepareInput
in interface OutOfCoreDataAccessor
threadId
- id of the thread involved in persistenceindex
- index chain of the data to access the serialized data formDataInput
representation of dataIOException
public OutOfCoreDataAccessor.DataOutputWrapper prepareOutput(int threadId, DataIndex index, boolean shouldAppend) throws IOException
OutOfCoreDataAccessor
DataOutput
representation for a
given thread involved in persistence for a given index chain for data.prepareOutput
in interface OutOfCoreDataAccessor
threadId
- id of the thread involved in persistenceindex
- index chain of the data to access the serialized data formshouldAppend
- whether the DataOutput
should be used for
appending to already existing data for the given index
or the DataOutput
should create new
instance to store serialized dataDataOutput
representation of dataIOException
public boolean dataExist(int threadId, DataIndex index)
OutOfCoreDataAccessor
dataExist
in interface OutOfCoreDataAccessor
threadId
- id of the thread involved in persistenceindex
- index chain used to access the dataCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.