public abstract class Store extends Object implements Engine
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
checksum |
protected static int |
CHECKSUM_FLAG_MASK |
protected static int |
CHUNK_SIZE |
protected static int |
CHUNK_SIZE_MOD_MASK |
protected boolean |
compress |
protected static int |
COMPRESS_FLAG_MASK |
protected boolean |
encrypt |
protected static int |
ENCRYPT_FLAG_MASK |
protected EncryptionXTEA |
encryptionXTEA |
protected ReentrantReadWriteLock[] |
locks |
protected static Logger |
LOG |
protected ThreadLocal<CompressLZF> |
LZF |
protected ReentrantReadWriteLock |
newRecidLock |
protected byte[] |
password |
protected Queue<DataOutput2> |
recycledDataOuts |
protected SerializerPojo |
serializerPojo
default serializer used for persistence.
|
protected Lock |
serializerPojoInitLock |
protected ReentrantLock |
structuralLock |
CATALOG_RECID, CHECK_RECORD, CLASS_INFO_RECID, LAST_RESERVED_RECID| Modifier | Constructor and Description |
|---|---|
protected |
Store(boolean checksum,
boolean compress,
byte[] password,
boolean disableLocks) |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
calculateStatistics()
get some statistics about store.
|
boolean |
canSnapshot() |
void |
closeListenerRegister(Runnable closeListener) |
void |
closeListenerUnregister(Runnable closeListener) |
protected <A> A |
deserialize(Serializer<A> serializer,
int size,
DataInput input) |
protected int |
expectedMasks() |
static Store |
forDB(DB db)
traverses
EngineWrappers and returns underlying Store |
static Store |
forEngine(Engine e)
traverses
EngineWrappers and returns underlying Store |
abstract long |
getCurrSize()
returns current size occupied by physical store (does not include index).
|
abstract Iterator<Long> |
getFreeRecids() |
abstract long |
getFreeSize()
returns free size in physical store (does not include index).
|
abstract long |
getMaxRecid() |
abstract ByteBuffer |
getRaw(long recid) |
SerializerPojo |
getSerializerPojo()
Returns default serializer associated with this engine.
|
abstract long |
getSizeLimit()
returns maximal store size or `0` if there is no limit
|
protected void |
lockAllWrite() |
protected static int |
lockPos(long key) |
protected DataOutput2 |
newDataOut2() |
void |
printStatistics() |
protected <A> DataOutput2 |
serialize(A value,
Serializer<A> serializer) |
Engine |
snapshot()
Returns read-only snapshot of data in Engine.
|
protected void |
unlockAllWrite() |
abstract void |
updateRaw(long recid,
ByteBuffer data) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanRollback, clearCache, close, commit, compact, compareAndSwap, delete, get, isClosed, isReadOnly, preallocate, preallocate, put, rollback, updateprotected static final Logger LOG
protected final boolean checksum
protected final boolean compress
protected final boolean encrypt
protected final byte[] password
protected final EncryptionXTEA encryptionXTEA
protected static final int CHECKSUM_FLAG_MASK
protected static final int COMPRESS_FLAG_MASK
protected static final int ENCRYPT_FLAG_MASK
protected static final int CHUNK_SIZE
protected static final int CHUNK_SIZE_MOD_MASK
protected SerializerPojo serializerPojo
protected final ThreadLocal<CompressLZF> LZF
protected Lock serializerPojoInitLock
protected final ReentrantLock structuralLock
protected final ReentrantReadWriteLock newRecidLock
protected final ReentrantReadWriteLock[] locks
protected final Queue<DataOutput2> recycledDataOuts
protected Store(boolean checksum,
boolean compress,
byte[] password,
boolean disableLocks)
public abstract long getMaxRecid()
public abstract ByteBuffer getRaw(long recid)
public abstract void updateRaw(long recid,
ByteBuffer data)
public abstract long getSizeLimit()
public abstract long getCurrSize()
public abstract long getFreeSize()
public abstract String calculateStatistics()
public void printStatistics()
public SerializerPojo getSerializerPojo()
EnginegetSerializerPojo in interface Engineprotected void lockAllWrite()
protected void unlockAllWrite()
protected <A> DataOutput2 serialize(A value, Serializer<A> serializer)
protected DataOutput2 newDataOut2()
protected <A> A deserialize(Serializer<A> serializer, int size, DataInput input) throws IOException
IOExceptionpublic static Store forDB(DB db)
EngineWrappers and returns underlying Storepublic static Store forEngine(Engine e)
EngineWrappers and returns underlying Storeprotected int expectedMasks()
protected static int lockPos(long key)
public boolean canSnapshot()
canSnapshot in interface Enginepublic Engine snapshot() throws UnsupportedOperationException
Enginesnapshot in interface EngineUnsupportedOperationException - if snapshots are not supported/enabledEngineWrapper.canSnapshot()public void closeListenerRegister(Runnable closeListener)
closeListenerRegister in interface Enginepublic void closeListenerUnregister(Runnable closeListener)
closeListenerUnregister in interface EngineCopyright © 2024. All rights reserved.