public static class EngineWrapper.ImmutabilityCheckEngine extends EngineWrapper
| Modifier and Type | Class and Description |
|---|---|
protected static class |
EngineWrapper.ImmutabilityCheckEngine.Item |
EngineWrapper.CloseOnJVMShutdown, EngineWrapper.ImmutabilityCheckEngine, EngineWrapper.ReadOnlyEngine, EngineWrapper.SerializerCheckEngineWrapper, EngineWrapper.SynchronizedEngineWrapper| Modifier and Type | Field and Description |
|---|---|
protected LongConcurrentHashMap<EngineWrapper.ImmutabilityCheckEngine.Item> |
items |
CLOSEDCATALOG_RECID, CHECK_RECORD, CLASS_INFO_RECID, LAST_RESERVED_RECID| Modifier | Constructor and Description |
|---|---|
protected |
ImmutabilityCheckEngine(Engine engine) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close store/cache.
|
<A> boolean |
compareAndSwap(long recid,
A expectedOldValue,
A newValue,
Serializer<A> serializer)
Updates existing record in atomic (Compare And Swap) manner.
|
<A> A |
get(long recid,
Serializer<A> serializer)
Get existing record.
|
<A> long |
put(A value,
Serializer<A> serializer)
Insert new record.
|
<A> void |
update(long recid,
A value,
Serializer<A> serializer)
Update existing record with new value.
|
canRollback, canSnapshot, checkClosed, clearCache, closeListenerRegister, closeListenerUnregister, commit, compact, delete, getSerializerPojo, getWrappedEngine, isClosed, isReadOnly, preallocate, preallocate, rollback, snapshotprotected LongConcurrentHashMap<EngineWrapper.ImmutabilityCheckEngine.Item> items
protected ImmutabilityCheckEngine(Engine engine)
public <A> A get(long recid,
Serializer<A> serializer)
Engineget in interface Engineget in class EngineWrapperrecid - (record identifier) under which record was persistedserializer - used to deserialize record from binary formpublic <A> long put(A value,
Serializer<A> serializer)
Engineput in interface Engineput in class EngineWrappervalue - records to be addedserializer - used to convert record into/from binary formpublic <A> void update(long recid,
A value,
Serializer<A> serializer)
Engineupdate in interface Engineupdate in class EngineWrapperrecid - (record identifier) under which record was persisted.value - new record value to be storedserializer - used to serialize record into binary formpublic <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
compareAndSwap in interface EnginecompareAndSwap in class EngineWrapperrecid - (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 void close()
EngineNullPointerException
There is an configuration option DBMaker.closeOnJvmShutdown() which uses shutdown hook to automatically
close Engine when JVM shutdowns.close in interface Engineclose in class EngineWrapper