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
EngineWrapper s and returns underlying Store |
static Store |
forEngine(Engine e)
traverses
EngineWrapper s 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, wait
canRollback, clearCache, close, commit, compact, compareAndSwap, delete, get, isClosed, isReadOnly, preallocate, preallocate, put, rollback, update
protected 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()
Engine
getSerializerPojo
in interface Engine
protected 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
IOException
public static Store forDB(DB db)
EngineWrapper
s and returns underlying Store
public static Store forEngine(Engine e)
EngineWrapper
s and returns underlying Store
protected int expectedMasks()
protected static int lockPos(long key)
public boolean canSnapshot()
canSnapshot
in interface Engine
public Engine snapshot() throws UnsupportedOperationException
Engine
snapshot
in interface Engine
UnsupportedOperationException
- if snapshots are not supported/enabledEngineWrapper.canSnapshot()
public void closeListenerRegister(Runnable closeListener)
closeListenerRegister
in interface Engine
public void closeListenerUnregister(Runnable closeListener)
closeListenerUnregister
in interface Engine
Copyright © 2015. All rights reserved.