Package org.nustaq.reallive.client
Class ShardedTable
java.lang.Object
org.nustaq.reallive.client.ShardedTable
- All Implemented Interfaces:
Serializable,ChangeReceiver,ChangeStream,RealLiveStreamActor,RealLiveTable,SafeChangeStream,SafeRealLiveStreamActor,SafeRealLiveTable
- Direct Known Subclasses:
DynShardedTable
Created by moelrue on 06.08.2015.
Provides a single view on to a sharded table client side
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TableDescriptionstatic booleanprotected AtomicBooleanprotected FilterProcessorprotected Set<RealLiveTable>protected Map<Integer,RealLiveTable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid_deepMerge(int senderId, Record jsonrec) voidorg.nustaq.kontraktor.IPromise<Boolean>voidaddNode(RealLiveTable shard) org.nustaq.kontraktor.IPromise<Boolean>protected voidadjustLimitFilter(RLPredicate filter) 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> voidforEachWithSpore(org.nustaq.kontraktor.Spore<Record, T> spore) org.nustaq.kontraktor.IPromise<Record>org.nustaq.kontraktor.IPromise<TableDescription>org.nustaq.kontraktor.IPromise<StorageStats>getStats()protected RealLiveTablegetTableForKey(String key) org.nustaq.kontraktor.IPromiseping()voidpruneRemoveLog(long maxAge) voidvoidqueryRemoveLog(long from, long to, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) voidrealUnsubscribe(Subscriber subs) voidreceive(ChangeMessage change) voidvoidremoveNode(org.nustaq.kontraktor.Actor actorRef) voidremoveTableShard(RealLiveTable shard2Remove) org.nustaq.kontraktor.IPromiseresizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes) voidvoidsetRecordAsIs(Record rec) administrative use only !org.nustaq.kontraktor.IPromise<Long>size()voidstop()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 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
-
DUMP_IN_PROC_CHANGES
public static boolean DUMP_IN_PROC_CHANGES -
description
-
tableShardMap
-
shards
-
proc
-
globalListenReady
-
-
Constructor Details
-
ShardedTable
-
-
Method Details
-
addNode
-
removeTableShard
-
getTableForKey
-
receive
- Specified by:
receivein interfaceChangeReceiver
-
resizeIfLoadFactorLarger
public org.nustaq.kontraktor.IPromise resizeIfLoadFactorLarger(double loadFactor, long maxGrowBytes) - Specified by:
resizeIfLoadFactorLargerin interfaceSafeRealLiveTable
-
subscribe
Description copied from interface:ChangeStreamDO NOT USE DIRECTLY, use subscribeOn etc.- Specified by:
subscribein interfaceChangeStream
-
adjustLimitFilter
-
unsubscribe
- Specified by:
unsubscribein interfaceChangeStream
-
unsubscribeById
public void unsubscribeById(int subsId) - Specified by:
unsubscribeByIdin interfaceRealLiveTable
-
realUnsubscribe
-
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
-
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
-
forEachWithSpore
- Specified by:
forEachWithSporein interfaceRealLiveStreamActor
-
ping
public org.nustaq.kontraktor.IPromise ping()- Specified by:
pingin interfaceSafeRealLiveTable
-
getDescription
- Specified by:
getDescriptionin interfaceSafeRealLiveTable
-
stop
public void stop()- Specified by:
stopin interfaceSafeRealLiveTable
-
getStats
- Specified by:
getStatsin interfaceSafeRealLiveTable
-
get
- Specified by:
getin interfaceSafeRealLiveTable
-
size
- Specified by:
sizein interfaceSafeRealLiveTable
-
removeNode
public void removeNode(org.nustaq.kontraktor.Actor actorRef) -
queryRemoveLog
public void queryRemoveLog(long from, long to, org.nustaq.kontraktor.Callback<RemoveLog.RemoveLogEntry> cb) - Specified by:
queryRemoveLogin interfaceRealLiveTable
-
pruneRemoveLog
public void pruneRemoveLog(long maxAge) - Specified by:
pruneRemoveLogin interfaceRealLiveTable
-