| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed
Deprecated.
true after file was closed
|
protected long |
currFileNum
Deprecated.
last file number, currently writing into
|
protected long |
currPos
Deprecated.
last used position, currently writing into
|
protected Volume |
currVolume
Deprecated.
last uses file, currently writing into
|
protected boolean |
deleteFilesAfterClose
Deprecated.
|
protected static long |
END
Deprecated.
at place of recid indicates uncommited transaction, an end of append log
|
protected java.io.File |
file
Deprecated.
storage file (without number
|
protected static long |
FILE_MASK
Deprecated.
mask used to get file offset from index val
|
protected static int |
FILE_SHIFT
Deprecated.
index value has two parts, first is file number, second is offset in file, this is how many bites file offset occupies
|
protected static long |
HEADER
Deprecated.
header at beginning of each file
|
protected Volume |
index
Deprecated.
index table which maps recid into position in index log
|
protected LongMap<java.lang.Long> |
indexInTx
Deprecated.
same as `index`, but stores uncommited modifications made in this transaction
|
protected static int |
MAX_FILE_SIZE_SHIFT
Deprecated.
|
protected long |
maxRecid
Deprecated.
maximal recid
|
protected boolean |
modified
Deprecated.
true after file was modified
|
protected boolean |
readOnly
Deprecated.
|
protected static long |
RECIDP
Deprecated.
add to recid before writing it to file
|
protected long |
rollbackCurrFileNum
Deprecated.
file number on last commit, used for rollback
|
protected long |
rollbackCurrPos
Deprecated.
file position on last commit, used for rollback
|
protected long |
rollbackMaxRecid
Deprecated.
maximial recid on last commit, used for rollback
|
protected static long |
SIZEP
Deprecated.
add to size before writing it to file
|
protected static long |
SKIP
Deprecated.
at place of recid indicates commited transaction, just ignore this value and continue
|
protected boolean |
syncOnCommit
Deprecated.
|
protected boolean |
tx
Deprecated.
transactions enabled
|
protected boolean |
useRandomAccessFile
Deprecated.
|
protected LongConcurrentHashMap<Volume> |
volumes
Deprecated.
contains opened files, key is file number
|
checksum, CHECKSUM_FLAG_MASK, CHUNK_SIZE, CHUNK_SIZE_MOD_MASK, closeListeners, compress, COMPRESS_FLAG_MASK, encrypt, ENCRYPT_FLAG_MASK, encryptionXTEA, locks, LOG, LZF, newRecidLock, password, recycledDataOuts, serializerPojo, serializerPojoInitLock, structuralLockCATALOG_RECID, CHECK_RECORD, CLASS_INFO_RECID, LAST_RESERVED_RECID| Constructor and Description |
|---|
StoreAppend(java.io.File file)
Deprecated.
|
StoreAppend(java.io.File file,
boolean useRandomAccessFile,
boolean readOnly,
boolean transactionDisabled,
boolean deleteFilesAfterClose,
boolean syncOnCommitDisabled,
boolean checksum,
boolean compress,
byte[] password,
boolean disableLocks)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
calculateStatistics()
Deprecated.
get some statistics about store.
|
boolean |
canRollback()
Deprecated.
|
void |
clearCache()
Deprecated.
clears any underlying cache
|
void |
close()
Deprecated.
Close store/cache.
|
void |
commit()
Deprecated.
Makes all changes made since the previous commit/rollback permanent.
|
void |
compact()
Deprecated.
|
<A> boolean |
compareAndSwap(long recid,
A expectedOldValue,
A newValue,
Serializer<A> serializer)
Deprecated.
Updates existing record in atomic (Compare And Swap) manner.
|
<A> void |
delete(long recid,
Serializer<A> serializer)
Deprecated.
Remove existing record from store/cache
Recid must be a number returned by 'put' method.
|
<A> A |
get(long recid,
Serializer<A> serializer)
Deprecated.
Get existing record.
|
long |
getCurrSize()
Deprecated.
returns current size occupied by physical store (does not include index).
|
protected java.io.File |
getFileFromNum(long fileNumber)
Deprecated.
|
java.util.Iterator<java.lang.Long> |
getFreeRecids()
Deprecated.
|
long |
getFreeSize()
Deprecated.
returns free size in physical store (does not include index).
|
long |
getMaxRecid()
Deprecated.
|
protected <A> A |
getNoLock(long recid,
Serializer<A> serializer)
Deprecated.
|
java.nio.ByteBuffer |
getRaw(long recid)
Deprecated.
|
long |
getSizeLimit()
Deprecated.
returns maximal store size or `0` if there is no limit
|
protected long |
indexVal(long recid)
Deprecated.
|
boolean |
isClosed()
Deprecated.
Checks whether Engine was closed.
|
boolean |
isReadOnly()
Deprecated.
Check if you can write into this Engine.
|
protected static int |
packedLongSize(long value)
Deprecated.
get number of bytes occupied by packed long
|
long |
preallocate()
Deprecated.
Preallocates recid for not yet created record.
|
void |
preallocate(long[] recids)
Deprecated.
Preallocates recids for not yet created record.
|
<A> long |
put(A value,
Serializer<A> serializer)
Deprecated.
Insert new record.
|
void |
rollback()
Deprecated.
Undoes all changes made in the current transaction.
|
protected void |
rollover()
Deprecated.
|
protected void |
setIndexVal(long recid,
long indexVal)
Deprecated.
|
<A> void |
update(long recid,
A value,
Serializer<A> serializer)
Deprecated.
Update existing record with new value.
|
protected void |
updateNoLock(long recid,
DataOutput2 out)
Deprecated.
|
void |
updateRaw(long recid,
java.nio.ByteBuffer data)
Deprecated.
|
canSnapshot, closeListenerRegister, closeListenerUnregister, deserialize, expectedMasks, forDB, forEngine, getSerializerPojo, lockAllWrite, lockPos, newDataOut2, printStatistics, serialize, snapshot, unlockAllWriteprotected static final long HEADER
protected static final int FILE_SHIFT
protected static final long FILE_MASK
protected static final int MAX_FILE_SIZE_SHIFT
protected static final long SIZEP
protected static final long RECIDP
protected static final long END
protected static final long SKIP
protected final java.io.File file
protected final boolean useRandomAccessFile
protected final boolean readOnly
protected final boolean syncOnCommit
protected final boolean deleteFilesAfterClose
protected final boolean tx
protected volatile boolean closed
protected volatile boolean modified
protected final LongConcurrentHashMap<Volume> volumes
protected Volume currVolume
protected long currPos
protected long currFileNum
protected long maxRecid
protected long rollbackCurrPos
protected long rollbackCurrFileNum
protected long rollbackMaxRecid
protected Volume index
protected final LongMap<java.lang.Long> indexInTx
public StoreAppend(java.io.File file,
boolean useRandomAccessFile,
boolean readOnly,
boolean transactionDisabled,
boolean deleteFilesAfterClose,
boolean syncOnCommitDisabled,
boolean checksum,
boolean compress,
byte[] password,
boolean disableLocks)
public StoreAppend(java.io.File file)
protected java.io.File getFileFromNum(long fileNumber)
protected void rollover()
protected long indexVal(long recid)
protected void setIndexVal(long recid,
long indexVal)
public long preallocate()
Enginepublic void preallocate(long[] recids)
Enginerecids - array to put result intopublic <A> long put(A value,
Serializer<A> serializer)
Enginevalue - records to be addedserializer - used to convert record into/from binary formpublic <A> A get(long recid,
Serializer<A> serializer)
Enginerecid - (record identifier) under which record was persistedserializer - used to deserialize record from binary formprotected <A> A getNoLock(long recid,
Serializer<A> serializer)
throws java.io.IOException
java.io.IOExceptionpublic <A> void update(long recid,
A value,
Serializer<A> serializer)
Enginerecid - (record identifier) under which record was persisted.value - new record value to be storedserializer - used to serialize record into binary formprotected void updateNoLock(long recid,
DataOutput2 out)
public <A> boolean compareAndSwap(long recid,
A expectedOldValue,
A newValue,
Serializer<A> serializer)
EngineoldValue==expectedOldValue when old value is found in instance cacheoldValue using serializer and checking oldValue.equals(expectedOldValue)expectedOldValue using serializer and comparing binary array with already serialized oldValue
recid - (record identifier) under which record was persisted.expectedOldValue - old value to be compared with existing recordnewValue - to be written if values are matchingserializer - used to serialize record into binary formpublic <A> void delete(long recid,
Serializer<A> serializer)
Enginerecid - (record identifier) under which was record persistedserializer - which may be used in some circumstances to deserialize and store old objectpublic void close()
EngineNullPointerException
There is an configuration option DBMaker.closeOnJvmShutdown() which uses shutdown hook to automatically
close Engine when JVM shutdowns.public boolean isClosed()
Enginepublic void commit()
Enginepublic void rollback()
throws java.lang.UnsupportedOperationException
EngineUnsupportedOperationException.java.lang.UnsupportedOperationException - if transactions are disabledpublic boolean canRollback()
public boolean isReadOnly()
Enginepublic void clearCache()
Enginepublic void compact()
public long getMaxRecid()
getMaxRecid in class Storepublic java.nio.ByteBuffer getRaw(long recid)
public java.util.Iterator<java.lang.Long> getFreeRecids()
getFreeRecids in class Storepublic void updateRaw(long recid,
java.nio.ByteBuffer data)
public long getSizeLimit()
StoregetSizeLimit in class Storepublic long getCurrSize()
StoregetCurrSize in class Storepublic long getFreeSize()
StoregetFreeSize in class Storepublic java.lang.String calculateStatistics()
StorecalculateStatistics in class Storeprotected static int packedLongSize(long value)