Class RealLiveTableActor
java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<RealLiveTableActor>
org.nustaq.reallive.server.actors.RealLiveTableActor
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Executor,org.nustaq.kontraktor.monitoring.Monitorable,ChangeReceiver,ChangeStream,RealLiveStreamActor,RealLiveTable,SafeChangeStream,SafeRealLiveStreamActor,SafeRealLiveTable
public class RealLiveTableActor extends org.nustaq.kontraktor.Actor<RealLiveTableActor> implements RealLiveTable
Created by ruedi on 06.08.2015.
core implementation of a table
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description java.lang.String__clientSideTagstatic booleanDUMP_QUERY_TIMEstatic longREPORT_INTERVALFields inherited from class org.nustaq.kontraktor.Actor
__cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallback -
Constructor Summary
Constructors Constructor Description RealLiveTableActor() -
Method Summary
Modifier and Type Method Description void_addSilent(Record rec)void_execQueriesOrDelay(int size, int taCount)void_removeSilent(java.lang.String key)org.nustaq.kontraktor.IPromise_setMapping(ClusterTableRecordMapping mapping)void_subscribe(RLPredicate pred, org.nustaq.kontraktor.Callback cb, int id)void_unsubscribe(org.nustaq.kontraktor.Callback cb, int id)org.nustaq.kontraktor.IPromise<java.lang.Boolean>add(int senderId, java.lang.String key, java.lang.Object... keyVals)protected java.lang.StringaddChannelIdIfPresent(org.nustaq.kontraktor.Callback cb, java.lang.String sid)org.nustaq.kontraktor.IPromise<java.lang.Boolean>addRecord(int senderId, Record rec)org.nustaq.kontraktor.IPromiseatomic(int senderId, java.lang.String key, RLFunction<Record,java.lang.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.voidatomicUpdate(RLPredicate<Record> filter, RLFunction<Record,java.lang.Boolean> action)mass update.<T> voidforEachDirect(org.nustaq.kontraktor.Spore<Record,T> spore)<T> voidforEachWithSpore(org.nustaq.kontraktor.Spore<Record,T> spore)org.nustaq.kontraktor.IPromise<Record>get(java.lang.String key)org.nustaq.kontraktor.IPromise<TableDescription>getDescription()ClusterTableRecordMappinggetMapping()org.nustaq.kontraktor.IPromise<ClusterTableRecordMapping>getRecordMapping()org.nustaq.kontraktor.IPromise<StorageStats>getStats()org.nustaq.kontraktor.IPromise<TableState>getTableState()protected voidhasStopped()org.nustaq.kontraktor.IPromiseinit(java.util.function.Function<TableDescription,RecordStorage> storeFactory, TableDescription desc)voidmerge(int senderId, java.lang.String key, java.lang.Object... keyVals)voidmergeRecord(int senderId, Record rec)voidput(int senderId, java.lang.String key, java.lang.Object... keyVals)voidreceive(ChangeMessage change)voidremove(int senderId, java.lang.String key)org.nustaq.kontraktor.IPromiseresizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes)voidsetRecord(int senderId, Record rec)org.nustaq.kontraktor.IPromise<java.lang.Long>size()voidsubscribe(Subscriber subs)DO NOT USE DIRECTLY, use subscribeOn etc.org.nustaq.kontraktor.IPromise<Record>take(int senderId, java.lang.String key)voidunsubscribe(Subscriber subs)voidunsubscribeById(int subsId)voidupdate(int senderId, java.lang.String key, java.lang.Object... keyVals)Methods inherited from class org.nustaq.kontraktor.Actor
__addDeadLetter, __addRemoteConnection, __addStopHandler, __dispatchRemoteCall, __enqueueCall, __getCachedMethod, __removeRemoteConnection, __stop, __stopImpl, __submit, ask, askMsg, asyncstop, checkThread, close, closeCurrentClient, current, cyclic, debounce, delayed, execInThreadPool, execute, getActor, getActorRef, getCallbackSize, getConnections, getCurrentDispatcher, getFactory, getMailboxSize, getQSizes, getReport, getScheduler, getSubMonitorables, getUntypedRef, inside, inThread, isCallbackQPressured, isEmpty, isMailboxPressured, isProxy, isPublished, isRemote, isStopped, ping, router$clientPing, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGCMethods inherited from class org.nustaq.kontraktor.Actors
AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, kYield, kYield, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yieldCallbacksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nustaq.reallive.api.ChangeStream
listen, observe, subscribeOn, subscribeOnMethods inherited from interface org.nustaq.reallive.api.RealLiveStreamActor
forEach, forEach, map, query
-
Field Details
-
REPORT_INTERVAL
public static final long REPORT_INTERVAL -
DUMP_QUERY_TIME
public static boolean DUMP_QUERY_TIME -
__clientSideTag
public transient java.lang.String __clientSideTag
-
-
Constructor Details
-
RealLiveTableActor
public RealLiveTableActor()
-
-
Method Details
-
init
public org.nustaq.kontraktor.IPromise init(java.util.function.Function<TableDescription,RecordStorage> storeFactory, TableDescription desc) -
getRecordMapping
-
receive
- Specified by:
receivein interfaceChangeReceiver
-
forEachDirect
-
forEachWithSpore
- Specified by:
forEachWithSporein interfaceRealLiveStreamActor
-
hasStopped
protected void hasStopped()- Overrides:
hasStoppedin classorg.nustaq.kontraktor.Actor<RealLiveTableActor>
-
subscribe
Description copied from interface:ChangeStreamDO NOT USE DIRECTLY, use subscribeOn etc.- Specified by:
subscribein interfaceChangeStream
-
_subscribe
-
_setMapping
-
getMapping
-
_execQueriesOrDelay
public void _execQueriesOrDelay(int size, int taCount) -
addChannelIdIfPresent
protected java.lang.String addChannelIdIfPresent(org.nustaq.kontraktor.Callback cb, java.lang.String sid) -
unsubscribe
- Specified by:
unsubscribein interfaceChangeStream
-
unsubscribeById
public void unsubscribeById(int subsId)- Specified by:
unsubscribeByIdin interfaceRealLiveTable
-
_unsubscribe
public void _unsubscribe(org.nustaq.kontraktor.Callback cb, int id) -
get
- Specified by:
getin interfaceSafeRealLiveTable
-
size
public org.nustaq.kontraktor.IPromise<java.lang.Long> size()- Specified by:
sizein interfaceSafeRealLiveTable
-
getDescription
- Specified by:
getDescriptionin interfaceSafeRealLiveTable
-
getStats
- Specified by:
getStatsin interfaceSafeRealLiveTable
-
atomic
public org.nustaq.kontraktor.IPromise atomic(int senderId, java.lang.String key, RLFunction<Record,java.lang.Object> action)Description copied from interface:RealLiveTableapply 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 broadcasted. Else the result of the action function is passed to the remote callee- Specified by:
atomicin interfaceRealLiveTable- Returns:
- the result of function.
-
atomicUpdate
Description copied from interface:RealLiveTablemass update.- Specified by:
atomicUpdatein interfaceRealLiveTable- Parameters:
filter- - selects recordsaction- - function, the function might modify the record using putField. If false is returned, the record is deleted
-
resizeIfLoadFactorLarger
public org.nustaq.kontraktor.IPromise resizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes)- Specified by:
resizeIfLoadFactorLargerin interfaceSafeRealLiveTable
-
put
public void put(int senderId, java.lang.String key, java.lang.Object... keyVals)- Specified by:
putin interfaceSafeRealLiveTable
-
merge
public void merge(int senderId, java.lang.String key, java.lang.Object... keyVals)- Specified by:
mergein interfaceSafeRealLiveTable
-
add
public org.nustaq.kontraktor.IPromise<java.lang.Boolean> add(int senderId, java.lang.String key, java.lang.Object... keyVals)- Specified by:
addin interfaceSafeRealLiveTable
-
addRecord
- Specified by:
addRecordin interfaceSafeRealLiveTable
-
mergeRecord
- Specified by:
mergeRecordin interfaceSafeRealLiveTable
-
setRecord
- Specified by:
setRecordin interfaceSafeRealLiveTable
-
update
public void update(int senderId, java.lang.String key, java.lang.Object... keyVals)- Specified by:
updatein interfaceSafeRealLiveTable
-
take
- Specified by:
takein interfaceSafeRealLiveTable
-
remove
public void remove(int senderId, java.lang.String key)- Specified by:
removein interfaceSafeRealLiveTable
-
_removeSilent
public void _removeSilent(java.lang.String key) -
_addSilent
-
getTableState
-