Class StorageDriver

java.lang.Object
org.nustaq.reallive.server.StorageDriver
All Implemented Interfaces:
Serializable, ChangeReceiver

public class StorageDriver extends Object implements ChangeReceiver
Created by moelrue on 03.08.2015. implements transaction processing on top of a physical storage
See Also:
  • Field Details

    • PROPAGATE_EMPTY_DIFFS

      public static boolean PROPAGATE_EMPTY_DIFFS
  • Constructor Details

  • Method Details

    • unwrap

      public static Record unwrap(Record r)
    • receive

      public void receive(ChangeMessage change)
      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:
      receive in interface ChangeReceiver
      Parameters:
      change -
    • getStore

      public RecordStorage getStore()
    • getListener

      public ChangeReceiver getListener()
    • store

      public StorageDriver store(RecordStorage store)
    • setListener

      public StorageDriver setListener(ChangeReceiver listener)
    • resizeIfLoadFactorLarger

      public void resizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes)
    • put

      public void put(int senderId, String key, Object... keyVals)
    • 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

      public void add(int senderId, String key, Object... keyVals)
    • add

      public void add(int senderId, Record rec)
    • put

      public void put(int senderId, Record rec)
    • update

      public void update(int senderId, String key, Object... keyVals)
    • remove

      public void remove(int senderId, String key)
    • _saveMapping

      public void _saveMapping(ClusterTableRecordMapping mapping)
    • _loadMapping

      public ClusterTableRecordMapping _loadMapping()
    • queryRemoveLog

      public void queryRemoveLog(long from, long to, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb)
    • pruneRemoveLog

      public void pruneRemoveLog(long maxAge)