public abstract class Store extends java.lang.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 |
(package private) java.util.List<java.lang.Runnable> |
closeListeners |
protected boolean |
compress |
protected static int |
COMPRESS_FLAG_MASK |
protected boolean |
encrypt |
protected static int |
ENCRYPT_FLAG_MASK |
protected EncryptionXTEA |
encryptionXTEA |
private static int |
LOCK_MASK |
protected java.util.concurrent.locks.ReentrantReadWriteLock[] |
locks |
protected static java.util.logging.Logger |
LOG |
protected java.lang.ThreadLocal<CompressLZF> |
LZF |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
newRecidLock |
protected byte[] |
password |
protected java.util.Queue<DataOutput2> |
recycledDataOuts |
protected SerializerPojo |
serializerPojo
default serializer used for persistence.
|
protected java.util.concurrent.locks.Lock |
serializerPojoInitLock |
protected java.util.concurrent.locks.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 java.lang.String |
calculateStatistics()
get some statistics about store.
|
boolean |
canSnapshot() |
void |
closeListenerRegister(java.lang.Runnable closeListener) |
void |
closeListenerUnregister(java.lang.Runnable closeListener) |
protected <A> A |
deserialize(Serializer<A> serializer,
int size,
java.io.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 java.util.Iterator<java.lang.Long> |
getFreeRecids() |
abstract long |
getFreeSize()
returns free size in physical store (does not include index).
|
abstract long |
getMaxRecid() |
abstract java.nio.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,
java.nio.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 java.util.logging.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 java.lang.ThreadLocal<CompressLZF> LZF
protected java.util.concurrent.locks.Lock serializerPojoInitLock
protected final java.util.concurrent.locks.ReentrantLock structuralLock
protected final java.util.concurrent.locks.ReentrantReadWriteLock newRecidLock
protected final java.util.concurrent.locks.ReentrantReadWriteLock[] locks
protected final java.util.Queue<DataOutput2> recycledDataOuts
private static final int LOCK_MASK
java.util.List<java.lang.Runnable> closeListeners
protected Store(boolean checksum,
boolean compress,
byte[] password,
boolean disableLocks)
public abstract long getMaxRecid()
public abstract java.nio.ByteBuffer getRaw(long recid)
public abstract java.util.Iterator<java.lang.Long> getFreeRecids()
public abstract void updateRaw(long recid,
java.nio.ByteBuffer data)
public abstract long getSizeLimit()
public abstract long getCurrSize()
public abstract long getFreeSize()
public abstract java.lang.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, java.io.DataInput input) throws java.io.IOException
java.io.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 java.lang.UnsupportedOperationException
Enginesnapshot in interface Enginejava.lang.UnsupportedOperationException - if snapshots are not supported/enabledEngineWrapper.canSnapshot()public void closeListenerRegister(java.lang.Runnable closeListener)
closeListenerRegister in interface Enginepublic void closeListenerUnregister(java.lang.Runnable closeListener)
closeListenerUnregister in interface Engine