Class RealLiveTableActor
java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<RealLiveTableActor>
org.nustaq.reallive.server.actors.RealLiveTableActor
- All Implemented Interfaces:
Serializable,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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nustaq.kontraktor.Actor
org.nustaq.kontraktor.Actor.ActorReport -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic final longFields inherited from class org.nustaq.kontraktor.Actor
__cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallbackFields inherited from class org.nustaq.kontraktor.Actors
CONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid_addSilent(Record rec) void_deepMerge(int senderId, Record jsonrec) void_execQueriesOrDelay(int size, int taCount) voidvoid_removeSilent(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<Boolean>protected StringaddChannelIdIfPresent(org.nustaq.kontraktor.Callback cb, String sid) org.nustaq.kontraktor.IPromise<Boolean>org.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.voidatomicUpdate(RLPredicate<Record> filter, RLFunction<Record, 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>org.nustaq.kontraktor.IPromise<TableDescription>org.nustaq.kontraktor.IPromise<ClusterTableRecordMapping>org.nustaq.kontraktor.IPromise<StorageStats>getStats()org.nustaq.kontraktor.IPromise<TableState>protected voidorg.nustaq.kontraktor.IPromiseinit(Function<TableDescription, RecordStorage> storeFactory, TableDescription desc) voidpruneRemoveLog(long maxAge) voidvoidqueryRemoveLog(long start, long end, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) voidreceive(ChangeMessage change) voidorg.nustaq.kontraktor.IPromiseresizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes) voidvoidsetRecordAsIs(Record rec) administrative use only !org.nustaq.kontraktor.IPromise<Long>size()voidsubscribe(Subscriber subs) DO NOT USE DIRECTLY, use subscribeOn etc.org.nustaq.kontraktor.IPromise<Record>voidunsubscribe(Subscriber subs) voidunsubscribeById(int subsId) voidvoidvoidupsertRecord(int senderId, Record rec) 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, listByQuery, map, queryMethods inherited from interface org.nustaq.reallive.api.RealLiveTable
atomic, find, queryList
-
Field Details
-
REPORT_INTERVAL
public static final long REPORT_INTERVAL -
DUMP_QUERY_TIME
public static boolean DUMP_QUERY_TIME -
__clientSideTag
-
-
Constructor Details
-
RealLiveTableActor
public RealLiveTableActor()
-
-
Method Details
-
init
public org.nustaq.kontraktor.IPromise init(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
-
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
- Specified by:
sizein interfaceSafeRealLiveTable
-
getDescription
- Specified by:
getDescriptionin interfaceSafeRealLiveTable
-
getStats
- Specified by:
getStatsin interfaceSafeRealLiveTable
-
atomic
public org.nustaq.kontraktor.IPromise atomic(int senderId, String key, RLFunction<Record, 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
- Specified by:
putin interfaceSafeRealLiveTable
-
upsert
- Specified by:
upsertin interfaceSafeRealLiveTable
-
_deepMerge
- Specified by:
_deepMergein interfaceSafeRealLiveTable
-
_join
- Specified by:
_joinin interfaceSafeRealLiveTable
-
add
- Specified by:
addin interfaceSafeRealLiveTable
-
addRecord
- Specified by:
addRecordin interfaceSafeRealLiveTable
-
upsertRecord
- Specified by:
upsertRecordin interfaceSafeRealLiveTable
-
setRecord
- Specified by:
setRecordin interfaceSafeRealLiveTable
-
setRecordAsIs
Description copied from interface:SafeRealLiveTableadministrative use only ! puts the record "identical", this means last modifiied and key are taken from given record.- Specified by:
setRecordAsIsin interfaceSafeRealLiveTable
-
update
- Specified by:
updatein interfaceSafeRealLiveTable
-
take
- Specified by:
takein interfaceSafeRealLiveTable
-
remove
- Specified by:
removein interfaceSafeRealLiveTable
-
_removeSilent
-
_addSilent
-
getTableState
-
queryRemoveLog
public void queryRemoveLog(long start, long end, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) - Specified by:
queryRemoveLogin interfaceRealLiveTable
-
pruneRemoveLog
public void pruneRemoveLog(long maxAge) - Specified by:
pruneRemoveLogin interfaceRealLiveTable
-