Package org.nustaq.reallive.server
Class StorageDriver
java.lang.Object
org.nustaq.reallive.server.StorageDriver
- All Implemented Interfaces:
Serializable,ChangeReceiver
Created by moelrue on 03.08.2015.
implements transaction processing on top of a physical storage
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid_saveMapping(ClusterTableRecordMapping mapping) voidvoidorg.nustaq.kontraktor.IPromiseatomic(int senderId, String key, RLFunction<Record, Object> action) apply the function to the record with given key and return the result inside a promise changes to the record inside the function are applied to the real record and a change message is generated.voidatomicQuery(int senderId, RLPredicate<Record> filter, RLFunction<Record, Boolean> action) getStore()voidpruneRemoveLog(long maxAge) voidvoidvoidqueryRemoveLog(long from, long to, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) voidreceive(ChangeMessage change) Semantics: We expect the change has NOT YET been applied.voidvoidresizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes) setListener(ChangeReceiver listener) store(RecordStorage store) static Recordvoid
-
Field Details
-
PROPAGATE_EMPTY_DIFFS
public static boolean PROPAGATE_EMPTY_DIFFS
-
-
Constructor Details
-
StorageDriver
-
-
Method Details
-
unwrap
-
receive
Semantics: We expect the change has NOT YET been applied. In case of updates we expect the diff to be correct. In case the diff is null, we compute it right here.- Specified by:
receivein interfaceChangeReceiver- Parameters:
change-
-
getStore
-
getListener
-
store
-
setListener
-
resizeIfLoadFactorLarger
public void resizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes) -
put
-
atomic
public org.nustaq.kontraktor.IPromise atomic(int senderId, String key, RLFunction<Record, Object> action) apply the function to the record with given key and return the result inside a promise changes to the record inside the function are applied to the real record and a change message is generated. In case the function returns a changemessage (add,putRecord,remove ..), the change message is applied to the original record and the change is broadcasted- Parameters:
key-action-- Returns:
- the result of function.
-
atomicQuery
public void atomicQuery(int senderId, RLPredicate<Record> filter, RLFunction<Record, Boolean> action) -
add
-
add
-
put
-
update
-
remove
-
_saveMapping
-
_loadMapping
-
queryRemoveLog
public void queryRemoveLog(long from, long to, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) -
pruneRemoveLog
public void pruneRemoveLog(long maxAge)
-