public final class StoreArchive extends Store
Store.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 static long |
DATA_START_OFFSET |
protected static long |
FILE_SIZE_OFFSET |
protected static long |
FIRST_RESERVED_RECID_OFFSET |
protected Volume |
vol |
protected long |
volSize |
caches, 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 |
|---|
StoreArchive(String fileName,
Volume.VolumeFactory volumeFactory,
boolean readonly) |
StoreArchive(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) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
add2(DataIO.DataOutputByteArray out) |
void |
backup(OutputStream out,
boolean incremental) |
void |
backupRestore(InputStream[] in) |
boolean |
canRollback() |
void |
close()
Close store/cache.
|
void |
commit()
Makes all changes made since the previous commit/rollback permanent.
|
void |
compact() |
protected <A> void |
delete2(long recid,
Serializer<A> serializer) |
boolean |
fileLoad()
If underlying storage is memory-mapped-file, this method will try to
load and precache all file data into disk cache.
|
protected <A> A |
get2(long recid,
Serializer<A> serializer) |
long |
getCurrSize() |
long |
getFreeSize() |
void |
init() |
long |
preallocate()
Preallocates recid for not yet created record.
|
<A> long |
put(A value,
Serializer<A> serializer)
Insert new record.
|
protected void |
rewriteNamedCatalog(NavigableMap<String,Object> catalog) |
void |
rollback()
Undoes all changes made in the current transaction.
|
Engine |
snapshot()
Returns read-only snapshot of data in Engine.
|
protected void |
update2(long recid,
DataIO.DataOutputByteArray out) |
assertReadLocked, assertWriteLocked, canSnapshot, checkFeaturesBitmap, clearCache, compareAndSwap, delete, deserialize, forDB, forEngine, get, getWrappedEngine, isClosed, isReadOnly, lockPos, longParityGet, longParitySet, makeFeaturesBitmap, metricsCollect, newDataOut2, serialize, updateprotected static final long FILE_SIZE_OFFSET
protected static final long FIRST_RESERVED_RECID_OFFSET
protected static final long DATA_START_OFFSET
protected Volume vol
protected long volSize
public StoreArchive(String fileName, Volume.VolumeFactory volumeFactory, boolean readonly)
public StoreArchive(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)
protected <A> A get2(long recid,
Serializer<A> serializer)
public <A> long put(A value,
Serializer<A> serializer)
Enginevalue - records to be addedserializer - used to convert record into/from binary formprotected long add2(DataIO.DataOutputByteArray out)
public 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.
public void commit()
Engineprotected void rewriteNamedCatalog(NavigableMap<String,Object> catalog)
public long getCurrSize()
getCurrSize in class Storeprotected void update2(long recid,
DataIO.DataOutputByteArray out)
protected <A> void delete2(long recid,
Serializer<A> serializer)
public long getFreeSize()
getFreeSize in class Storepublic boolean fileLoad()
Store
If underlying storage is memory-mapped-file, this method will try to
load and precache all file data into disk cache.
Most likely it will call MappedByteBuffer.load(),
but could also read content of entire file etc
This method will not pin data into memory, they might be removed at any time.
public void backup(OutputStream out, boolean incremental)
public void backupRestore(InputStream[] in)
backupRestore in class Storepublic long preallocate()
Enginepublic void rollback()
throws UnsupportedOperationException
EngineUnsupportedOperationException.UnsupportedOperationException - if transactions are disabledpublic boolean canRollback()
public Engine snapshot() throws UnsupportedOperationException
EngineUnsupportedOperationException - if snapshots are not supported/enabledpublic void compact()
Copyright © 2015. All Rights Reserved.