public class StoreWAL extends StoreCached
StoreDirect.SnapshotStore.Cache, Store.LongList, Store.LongLongMap, Store.LongObjectMap<V>, Store.LongObjectObjectMap<V1,V2>, Store.LongQueue, Store.MemoryBarrierLessLock, Store.ReadWriteSingleLockEngine.CloseOnJVMShutdown, Engine.ReadOnly, Engine.ReadOnlyWrapper| Modifier and Type | Field and Description |
|---|---|
protected boolean |
$_TEST_HACK_COMPACT_POST_COMMIT_WAIT |
protected boolean |
$_TEST_HACK_COMPACT_PRE_COMMIT_WAIT |
protected Store.LongLongMap[] |
committedDataLongs
Contains vol modifications from previous committed transactions, which are not yet replayed into vol.
|
protected Store.LongLongMap[] |
committedIndexTable
Contains index table modifications from previous committed transactions, which are not yet replayed into vol.
|
protected Store.LongLongMap |
committedPageLongStack
Contains modified Long Stack Pages from previous committed transactions, which are not yet replayed into vol.
|
protected static int |
FULL_REPLAY_AFTER_N_TX |
protected byte[] |
headVolBackup |
protected long[] |
indexPagesBackup |
protected Volume |
realVol |
protected Store.LongLongMap[] |
uncommittedDataLongs
Contains vol modifications from current not yet committed transaction.
|
protected Store.LongLongMap[] |
uncommittedIndexTable
Contains index table modifications from current not yet committed transaction.
|
protected WriteAheadLog |
wal |
flushInThread, LONG_STACK_PAGE_TOMBSTONE, TOMBSTONE2, uncommittedStackPages, writeCache, writeQueueSize, writeQueueSizePerSegmentEMPTY_LONGS, executor, FREE_RECID_STACK, freeSize, HEAD_END, HEADER, headVol, INDEX_VAL_SIZE, indexPages, INITCRC_INDEX_PAGE, LAST_PHYS_ALLOCATED_DATA_OFFSET, LONG_STACK_MAX_SIZE, LONG_STACK_MIN_SIZE, LONG_STACK_PREF_SIZE, MARCHIVE, MAX_REC_SIZE, MAX_RECID_OFFSET, MLINKED, MOFFSET, MPARITY, MUNUSED, PAGE_MASK, PAGE_MASK_INVERSE, PAGE_SIZE, recidReuseDisable, sizeIncrement, sliceShift, SLOTS_COUNT, snapshots, startSize, STORE_SIZE, STORE_VERSION, UNUSED1, UNUSED2, UNUSED3, UNUSED4, UNUSED5, volcaches, checksum, closed, commitLock, compress, deserializeExtra, encrypt, encryptionXTEA, FEAT_COMP_LZF, FEAT_CRC, FEAT_ENC_XTEA, fileLockDisable, fileLockHeartbeat, fileName, HEAD_CHECKSUM, HEAD_FEATURES, LOCKING_STRATEGY_NOLOCK, LOCKING_STRATEGY_READWRITELOCK, LOCKING_STRATEGY_WRITELOCK, lockMask, locks, lockScale, LOG, LZF, metricsDataRead, metricsDataWrite, metricsRecordRead, metricsRecordWrite, NOLOCK, readonly, recycledDataOut, snapshotEnable, structuralLock, volumeFactoryCLOSED_ENGINE, RECID_CLASS_CATALOG, RECID_FIRST, RECID_LAST_RESERVED, RECID_NAME_CATALOG, RECID_RECORD_CHECK| Constructor and Description |
|---|
StoreWAL(String fileName) |
StoreWAL(String fileName,
Volume.VolumeFactory volumeFactory,
Store.Cache cache,
int lockScale,
int lockingStrategy,
boolean checksum,
boolean compress,
byte[] password,
boolean readonly,
boolean snapshotEnable,
boolean fileLockDisable,
DataIO.HeartbeatFileLock fileLockHeartbeat,
ScheduledExecutorService executor,
long startSize,
long sizeIncrement,
boolean recidReuseDisable,
long executorScheduledRate,
int writeQueueSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRollback() |
void |
close()
Close store/cache.
|
void |
commit()
Makes all changes made since the previous commit/rollback permanent.
|
void |
compact() |
protected void |
freeDataPut(int segment,
long offset,
int size) |
protected <A> A |
get2(long recid,
Serializer<A> serializer) |
protected boolean |
hasUncommitedData()
return true if there are uncommited data in current transaction, otherwise false
|
protected void |
indexLongPut(long offset,
long val) |
protected long |
indexValGet(long recid) |
protected long |
indexValGetRaw(long recid) |
protected void |
indexValPut(long recid,
int size,
long offset,
boolean linked,
boolean unused) |
protected void |
initCreate() |
protected void |
initFailedCloseFiles() |
protected void |
initHeadVol() |
void |
initOpen() |
protected void |
initOpenPost() |
protected byte[] |
loadLongStackPage(long pageOffset,
boolean willBeModified) |
protected long[] |
offsetsGet(int segment,
long indexVal)
return positions of (possibly) linked record
|
protected long |
pageAllocate() |
protected void |
putDataSingleWithLink(int segment,
long offset,
long link,
byte[] buf,
int bufPos,
int size) |
protected void |
putDataSingleWithoutLink(int segment,
long offset,
byte[] buf,
int bufPos,
int size) |
protected void |
replaySoft() |
void |
rollback()
Undoes all changes made in the current transaction.
|
protected DataInput |
walGetData(long offset,
int segment) |
assertLongStackPage, assertNoOverlaps, compareAndSwap, delete2, flush, flushWriteCache, flushWriteCacheSegment, longStackCount, longStackNewPage, longStackPut, longStackTake, put, updatebackup, backupRestore, clearCache, closeFilesIgnoreException, compactIndexPage, compactIndexPages, compactOldFilesExists, composeIndexVal, fileLoad, freeDataPut, freeDataTake, freeDataTakeSingle, freeRecidTake, freeSizeIncrement, getCurrSize, getFreeSize, getFromOffset, headChecksum, init, lastAllocatedDataGet, lastAllocatedDataSet, longStackMasterLinkOffset, maxRecidGet, maxRecidSet, offsetsTotalSize, offsetsVerify, pageIndexEnsurePageForRecidAllocated, pageIndexExtend, preallocate, putData, recidToOffset, recidTooLarge, round16Up, snapshot, snapshotCloseAllOnCompact, storeSizeGet, storeSizeSet, update2assertReadLocked, assertWriteLocked, canSnapshot, checkFeaturesBitmap, delete, deserialize, forDB, forEngine, get, getWrappedEngine, isClosed, isReadOnly, lockPos, longParityGet, longParitySet, makeFeaturesBitmap, metricsCollect, newDataOut2, serializeprotected static final int FULL_REPLAY_AFTER_N_TX
protected final Store.LongLongMap[] committedIndexTable
protected final Store.LongLongMap[] uncommittedIndexTable
protected final Store.LongLongMap[] committedDataLongs
WriteAheadLog.walPutByteArray(long, byte[], int, int)protected final Store.LongLongMap[] uncommittedDataLongs
WriteAheadLog.walPutByteArray(long, byte[], int, int)protected final Store.LongLongMap committedPageLongStack
WriteAheadLog.walPutByteArray(long, byte[], int, int)protected byte[] headVolBackup
protected long[] indexPagesBackup
protected Volume realVol
protected volatile boolean $_TEST_HACK_COMPACT_PRE_COMMIT_WAIT
protected volatile boolean $_TEST_HACK_COMPACT_POST_COMMIT_WAIT
protected final WriteAheadLog wal
public StoreWAL(String fileName)
public StoreWAL(String fileName, Volume.VolumeFactory volumeFactory, Store.Cache cache, int lockScale, int lockingStrategy, boolean checksum, boolean compress, byte[] password, boolean readonly, boolean snapshotEnable, boolean fileLockDisable, DataIO.HeartbeatFileLock fileLockHeartbeat, ScheduledExecutorService executor, long startSize, long sizeIncrement, boolean recidReuseDisable, long executorScheduledRate, int writeQueueSize)
protected void initCreate()
initCreate in class StoreDirectpublic void initOpen()
initOpen in class StoreDirectprotected void initFailedCloseFiles()
initFailedCloseFiles in class StoreDirectprotected void initOpenPost()
protected void initHeadVol()
initHeadVol in class StoreCachedprotected void putDataSingleWithLink(int segment,
long offset,
long link,
byte[] buf,
int bufPos,
int size)
putDataSingleWithLink in class StoreDirectprotected void putDataSingleWithoutLink(int segment,
long offset,
byte[] buf,
int bufPos,
int size)
putDataSingleWithoutLink in class StoreDirectprotected DataInput walGetData(long offset, int segment)
protected long indexValGet(long recid)
indexValGet in class StoreDirectprotected long indexValGetRaw(long recid)
indexValGetRaw in class StoreDirectprotected void indexValPut(long recid,
int size,
long offset,
boolean linked,
boolean unused)
indexValPut in class StoreDirectprotected void indexLongPut(long offset,
long val)
indexLongPut in class StoreDirectprotected long pageAllocate()
pageAllocate in class StoreDirectprotected byte[] loadLongStackPage(long pageOffset,
boolean willBeModified)
loadLongStackPage in class StoreCachedprotected long[] offsetsGet(int segment,
long indexVal)
offsetsGet in class StoreDirectprotected <A> A get2(long recid,
Serializer<A> serializer)
get2 in class StoreCachedpublic void rollback()
throws UnsupportedOperationException
EngineUnsupportedOperationException.rollback in interface Enginerollback in class StoreDirectUnsupportedOperationException - if transactions are disabledpublic void commit()
Enginecommit in interface Enginecommit in class StoreDirectprotected void replaySoft()
public boolean canRollback()
canRollback in interface EnginecanRollback in class StoreDirectpublic void close()
EngineClose store/cache. This method must be called before JVM exits to flush all caches and prevent store corruption. Also it releases resources used by MapDB (disk, memory..).
Engine can no longer be used after this method was called. If Engine is used after closing, it may
throw any exception including NullPointerException
There is an configuration option DBMaker.Maker.closeOnJvmShutdown() which uses shutdown hook to automatically
close Engine when JVM shutdowns.
close in interface Closeableclose in interface AutoCloseableclose in interface Engineclose in class StoreDirectpublic void compact()
compact in interface Enginecompact in class StoreDirectprotected boolean hasUncommitedData()
protected void freeDataPut(int segment,
long offset,
int size)
freeDataPut in class StoreDirectCopyright © 2015. All Rights Reserved.