public final class BlockBasedDataStore extends AbstractBlockBasedDataStore
AB_ALLOCSIZE_OFFSET, AB_FLAGS_OFFSET, AB_NEXTBLOCK_OFFSET, AB_PREVBLOCK_OFFSET, allocatedSize, ALLOCATION_TABLE_SUFFIX, allocationTableFile, allocationTableRandomAccessFile, AT_BLOCK_SIZE, AT_HEADER_BLOCKCOUNT_OFFSET, AT_HEADER_FIRSTBLOCK_OFFSET, AT_HEADER_SIZE, blockCount, blockSize, DATA_FILE_SUFFIX, dataFile, dataRandomAccessFile, descriptor, firstBlock, flags, nextBlock, previousBlocklocks, SAFE_MODE| Constructor and Description |
|---|
BlockBasedDataStore(QueueDefinition queueDef)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
commitChanges()
Ensure everything's persisted (synchronous)
|
void |
commitChanges(SynchronizationBarrier barrier)
Ensure everything's persisted (asynchronous)
|
protected void |
extendStoreFiles(int oldBlockCount,
int newBlockCount)
Extend the store files to newBlockCount
|
protected void |
flush()
Flush internal buffers
|
protected void |
initFilesystem() |
protected void |
readDataBlock(byte[] data,
int offset,
int len,
int blockHandle)
Read a data block to disk
|
protected void |
writeAllocationBlock(int blockIndex)
Write an allocation block to disk
|
protected void |
writeDataBlock(byte[] data,
int offset,
int len,
int blockHandle)
Write a data block to disk
|
protected void |
writeFirstBlock()
Write the first block index to disk
|
checkHandle, close, delete, first, getAbsoluteStoreUsage, getBlockSize, getStoreUsage, init, integrityCheck, next, previous, replace, retrieve, retrieveHeader, serializeAllocationBlock, size, store, toStringisLocked, lock, unlockpublic BlockBasedDataStore(QueueDefinition queueDef)
protected void initFilesystem()
throws DataStoreException
initFilesystem in class AbstractBlockBasedDataStoreDataStoreExceptionprotected void writeFirstBlock()
throws DataStoreException
AbstractBlockBasedDataStorewriteFirstBlock in class AbstractBlockBasedDataStoreDataStoreExceptionprotected void writeAllocationBlock(int blockIndex)
throws DataStoreException
AbstractBlockBasedDataStorewriteAllocationBlock in class AbstractBlockBasedDataStoreDataStoreExceptionprotected void writeDataBlock(byte[] data,
int offset,
int len,
int blockHandle)
throws DataStoreException
AbstractBlockBasedDataStorewriteDataBlock in class AbstractBlockBasedDataStoreDataStoreExceptionprotected void readDataBlock(byte[] data,
int offset,
int len,
int blockHandle)
throws DataStoreException
AbstractBlockBasedDataStorereadDataBlock in class AbstractBlockBasedDataStoreDataStoreExceptionprotected void extendStoreFiles(int oldBlockCount,
int newBlockCount)
throws DataStoreException
AbstractBlockBasedDataStoreextendStoreFiles in class AbstractBlockBasedDataStoreDataStoreExceptionpublic void commitChanges()
throws DataStoreException
DataStoreDataStoreExceptionpublic void commitChanges(SynchronizationBarrier barrier) throws DataStoreException
DataStoreDataStoreExceptionprotected void flush()
throws DataStoreException
AbstractBlockBasedDataStoreflush in class AbstractBlockBasedDataStoreDataStoreExceptionCopyright © 2021. All rights reserved.