org.mapdb
Class StoreWAL
- java.lang.Object
-
- org.mapdb.Store
-
- org.mapdb.StoreDirect
-
- org.mapdb.StoreCached
-
- org.mapdb.StoreWAL
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable, Engine
public class StoreWAL extends StoreCached
Write-Ahead-Log
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mapdb.StoreDirect
StoreDirect.Snapshot
-
Nested classes/interfaces inherited from class org.mapdb.Store
Store.Cache, Store.LongLongMap, Store.LongObjectMap<V>, Store.LongObjectObjectMap<V1,V2>, Store.LongQueue, Store.MemoryBarrierLessLock, Store.ReadWriteSingleLock
-
Nested classes/interfaces inherited from interface org.mapdb.Engine
Engine.CloseOnJVMShutdown, Engine.ReadOnly, Engine.ReadOnlyWrapper
-
-
Field Summary
-
Fields inherited from class org.mapdb.Store
LOCKING_STRATEGY_NOLOCK, LOCKING_STRATEGY_READWRITELOCK, LOCKING_STRATEGY_WRITELOCK, NOLOCK
-
Fields inherited from interface org.mapdb.Engine
CLOSED_ENGINE, RECID_CLASS_CATALOG, RECID_FIRST, RECID_LAST_RESERVED, RECID_NAME_CATALOG, RECID_RECORD_CHECK
-
-
Constructor Summary
Constructors Constructor and Description StoreWAL(java.lang.String fileName)StoreWAL(java.lang.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, java.util.concurrent.ScheduledExecutorService executor, long startSize, long sizeIncrement, boolean recidReuseDisable, long executorScheduledRate, int writeQueueSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanRollback()voidclose()Close store/cache.voidcommit()Makes all changes made since the previous commit/rollback permanent.voidcompact()voidinitOpen()voidrollback()Undoes all changes made in the current transaction.-
Methods inherited from class org.mapdb.StoreCached
compareAndSwap, put, update
-
Methods inherited from class org.mapdb.StoreDirect
backup, backupRestore, clearCache, fileLoad, getCurrSize, getFreeSize, init, preallocate, snapshot
-
Methods inherited from class org.mapdb.Store
canSnapshot, delete, forDB, forEngine, get, getWrappedEngine, isClosed, isReadOnly, metricsCollect
-
-
-
-
Constructor Detail
-
StoreWAL
public StoreWAL(java.lang.String fileName)
-
StoreWAL
public StoreWAL(java.lang.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, java.util.concurrent.ScheduledExecutorService executor, long startSize, long sizeIncrement, boolean recidReuseDisable, long executorScheduledRate, int writeQueueSize)
-
-
Method Detail
-
initOpen
public void initOpen()
-
rollback
public void rollback() throws java.lang.UnsupportedOperationExceptionDescription copied from interface:EngineUndoes all changes made in the current transaction. If transactions are disabled it throwsUnsupportedOperationException.- Specified by:
rollbackin interfaceEngine- Overrides:
rollbackin classStoreDirect- Throws:
java.lang.UnsupportedOperationException- if transactions are disabled
-
commit
public void commit()
Description copied from interface:EngineMakes all changes made since the previous commit/rollback permanent. In transactional mode (on by default) it means creating journal file and replaying it to storage. In other modes it may flush disk caches or do nothing at all (check your config options)- Specified by:
commitin interfaceEngine- Overrides:
commitin classStoreDirect
-
canRollback
public boolean canRollback()
- Specified by:
canRollbackin interfaceEngine- Overrides:
canRollbackin classStoreDirect- Returns:
- true if engine supports rollback
-
close
public void close()
Description copied from interface: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
NullPointerExceptionThere is an configuration option
DBMaker.Maker.closeOnJvmShutdown()which uses shutdown hook to automatically close Engine when JVM shutdowns.- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceEngine- Overrides:
closein classStoreDirect
-
compact
public void compact()
- Specified by:
compactin interfaceEngine- Overrides:
compactin classStoreDirect
-
-
DataMelt 3.0 © DataMelt by jWork.ORG