Package com.illumon.iris.db.v2.remote
Class PreemptiveUpdatesTable
java.lang.Object
com.illumon.util.referencecounting.ReferenceCounted
com.illumon.iris.db.util.liveness.ReferenceCountedLivenessNode
com.illumon.iris.db.util.liveness.LivenessArtifact
com.illumon.iris.db.v2.BaseTable
com.illumon.iris.db.v2.remote.WrappedDelegatingTable
com.illumon.iris.db.v2.remote.PreemptiveUpdatesTable
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,NotificationQueue.Dependency,Deflatable<Table>,Table,LivenessManager,LivenessNode,LivenessReferent,LongSizedDataStructure,DynamicNode,DynamicTable,NotificationStepReceiver,NotificationStepSource,SubscribableTable,SystemicObject,Serializable
The server side representation of a preemptive updates table, which wraps an original table.
When a client subscribes initially, a snapshot of the table is sent. The snapshot is obtained using either get()
or getPrev() based on the state of the LogicalClock. On each subsequent update, the client is given the deltas
between the last update propagation and the next.
On the client side, this table will be represented by a
ReplicatedTable.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested classes/interfaces inherited from class com.illumon.iris.db.v2.remote.WrappedDelegatingTable
WrappedDelegatingTable.DoNotWrapNested classes/interfaces inherited from class com.illumon.iris.db.v2.BaseTable
BaseTable.CopyAttributeOperation, BaseTable.ListenerImpl, BaseTable.ShiftAwareListenerImpl, BaseTable.SwapListenerFactory<T extends SwapListenerBase>Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.Table
Table.AsOfMatchRule, Table.GroupStrategy, Table.RenameFunction -
Field Summary
Fields inherited from class com.illumon.iris.db.v2.BaseTable
attributes, definition, description, PRINT_SERIALIZED_UPDATE_OVERLAPS, sharedAttributesFields inherited from interface com.illumon.iris.db.v2.NotificationStepReceiver
NULL_NOTIFICATION_STEPFields inherited from interface com.illumon.iris.db.tables.Table
ACL_ATTRIBUTE, ADD_ONLY_TABLE_ATTRIBUTE, COLUMN_DESCRIPTIONS_ATTRIBUTE, COLUMN_RENDERERS_ATTRIBUTE, CUSTOM_ACTIONS_ATTRIBUTE, DO_NOT_MAKE_REMOTE_ATTRIBUTE, EMPTY_SOURCE_TABLE_ATTRIBUTE, FILTERABLE_COLUMNS_ATTRIBUTE, HIERARCHICAL_CHILDREN_TABLE_MAP_ATTRIBUTE, HIERARCHICAL_SOURCE_INFO_ATTRIBUTE, HIERARCHICAL_SOURCE_TABLE_ATTRIBUTE, INPUT_TABLE_ATTRIBUTE, KEY_COLUMNS_ATTRIBUTE, LAYOUT_HINTS_ATTRIBUTE, MERGED_TABLE_ATTRIBUTE, NON_DISPLAY_TABLE, PLUGIN_NAME, PREDEFINED_ROLLUP_ATTRIBUTE, PREEMPTIVE_VIEWPORT_TYPE, PREPARED_RLL_ATTRIBUTE, PREVIEW_PARENT_TABLE, REVERSE_LOOKUP_ATTRIBUTE, ROLLUP_LEAF_ATTRIBUTE, SNAPSHOT_VIEWPORT_TYPE, SORTABLE_COLUMNS_ATTRIBUTE, SORTED_COLUMNS_ATTRIBUTE, SYSTEMIC_TABLE_ATTRIBUTE, TABLE_DESCRIPTION_ATTRIBUTE, TOTALS_TABLE_ATTRIBUTE, TREE_TABLE_FILTER_REVERSE_LOOKUP_ATTRIBUTE, UNIQUE_KEYS_ATTRIBUTE, UNTRACKED_LASTBY_TABLE_ATTRIBUTE, VIEWPORT_TYPE_ATTRIBUTE, ZERO_LENGTH_TABLE_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int handleId, BitSet columnsToSubscribe, boolean isViewport) Add a subscription to this table.static voidcopyPartialColumns(Index sourceIndex, Index destIndex, Object[] sourceDataColumns, Object[] destDataColumns) protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.getIndex()booleanisFlat()Return true if this table is guaranteed to be flat.booleanTrue if this table is a snapshot table (as opposed to a preemptive updates table); used byRemoteQueryProcessorto set the isSnapshot flag onExportedTableCreationMessagemessages, so that a client knows if it has an appropriate type of table for its viewport.static voidlogPremptiveUpdateTableStatistics(com.fishlib.io.logger.Logger log) Log the count of created, destroyed, and subscribed PreemptiveUpdatesTables in this worker.voidMark this object as systemically important.preemptiveSnapshotTable(long updateInterval) preemptiveUpdatesTable(long updateInterval) booleanremoveSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId) Remove a subscription.rollup(ComboAggregateFactory comboAggregateFactory, boolean includeConstituents, SelectColumn... columns) voidsetAttribute(String key, Object object) Set the value of an attribute.voidsetLastNotificationStep(long lastNotificationStep) Deliver a last notification step to this receiver.longsize()The size of this data structure.longCreate a hierarchical tree table.booleanupdateSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, BitSet newSubscribedColumns) Update the subscription's columns.booleanupdateViewport(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, Index newViewPort) Update the subscription's viewport (rows).booleanupdateViewportAndColumns(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, Index newViewPort, BitSet columnsToSubscribe) Update the subscription's columns and viewport (rows).Methods inherited from class com.illumon.iris.db.v2.remote.WrappedDelegatingTable
absSumBy, aj, apply, applyToAllBy, avgBy, by, byExternal, countBy, dropColumns, exactJoin, firstBy, flatten, getColumn, getColumnSource, getColumnSourceMap, getColumnSources, getRecord, getSubTable, head, headBy, headPct, join, lastBy, lazyUpdate, leftJoin, maxBy, medianBy, minBy, naturalJoin, raj, renameColumns, reverse, select, selectDistinct, silent, slice, snapshot, snapshotHistory, snapshotIncremental, sort, stdBy, sumBy, tail, tailBy, tailPct, ungroup, update, updateBy, updateView, validateSelect, varBy, view, wavgBy, where, whereIn, wouldMatch, wsumByMethods inherited from class com.illumon.iris.db.v2.BaseTable
addParentReference, append, awaitUpdate, awaitUpdate, clearSortingRestrictions, copy, copyAttributes, copyAttributes, createSwapListenerIfRefreshing, getAttribute, getAttributeNames, getAttributes, getDefinition, getDescription, getLastNotificationStep, getNotificationQueue, hasAttribute, initializeWithSnapshot, isAddOnly, isAddOnly, isFailed, isRefreshing, isSystemicObject, layoutHints, listenForDirectUpdates, listenForUpdates, listenForUpdates, notifyListeners, notifyListenersOnError, removeDirectUpdateListener, removeUpdateListener, removeUpdateListener, restrictSortTo, satisfied, setColumnRenderers, setRefreshing, setTotalsTable, shouldCopyAttribute, toString, withColumnDescription, withKeys, withTableDescription, withUniqueKeysMethods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifact
manageWithCurrentScope, unmanage, unmanageMethods inherited from class com.illumon.iris.db.util.liveness.ReferenceCountedLivenessNode
dropReference, getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryRetainReferenceMethods inherited from class com.illumon.util.referencecounting.ReferenceCounted
decrementReferenceCount, incrementReferenceCount, resetReferenceCount, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.DynamicTable
listenForUpdates, newModifiedColumnSet, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetTransformer, newModifiedColumnSetTransformer, newModifiedColumnSetTransformer, notifyListenersMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessManager
manage, tryManageMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSizeMethods inherited from interface com.illumon.iris.db.tables.Table
absSumBy, absSumBy, absSumBy, aj, aj, aj, aj, aj, applyToAllBy, applyToAllBy, applyToAllBy, avgBy, avgBy, avgBy, by, by, by, by, by, by, byExternal, byteColumnIterator, characterColumnIterator, close, coalesce, columnIterator, countBy, countBy, countBy, dateTimeColumnAsNanos, dateTimeColumnAsNanos, deflate, deflate, doubleColumnIterator, dropColumnFormats, dropColumns, exactJoin, exactJoin, exactJoin, exactJoin, firstBy, firstBy, firstBy, floatColumnIterator, formatColumns, formatColumnWhere, formatRowWhere, getAttributes, getColumn, getColumns, getColumnSource, getMeta, getViewPort, hasColumns, hasColumns, headBy, headBy, integerColumnIterator, isEmpty, isLive, join, join, join, join, join, join, join, join, join, lastBy, lastBy, lastBy, layoutHints, lazyUpdate, lazyUpdate, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, longColumnIterator, maxBy, maxBy, maxBy, medianBy, medianBy, medianBy, minBy, minBy, minBy, moveColumns, moveColumns, moveDownColumns, moveUpColumns, naturalJoin, naturalJoin, naturalJoin, naturalJoin, preemptiveSnapshotTable, raj, raj, raj, raj, raj, releaseCachedResources, renameAllColumns, renameColumns, renameColumns, rollup, rollup, rollup, rollup, rollup, rollup, rollup, select, select, select, selectDistinct, selectDistinct, selectDistinct, shortColumnIterator, snapshot, snapshotIncremental, sort, sort, sortDescending, sortDescending, stdBy, stdBy, stdBy, subscribeToPreemptiveUpdates, sumBy, sumBy, sumBy, supportsPreemptiveSubscription, tailBy, tailBy, ungroup, ungroup, ungroup, ungroupAllBut, update, update, updateBy, updateBy, updateBy, updateBy, updateBy, updateView, updateView, validateSelect, varBy, varBy, varBy, view, view, wavgBy, wavgBy, wavgBy, where, where, where, whereIn, whereIn, whereIn, whereNotIn, whereNotIn, whereOneOf, whereOneOf, whereOneOf, withColumnDescription, wouldMatch, wsumBy, wsumBy, wsumBy
-
Method Details
-
destroy
protected void destroy()Description copied from class:ReferenceCountedLivenessNodeAttempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().
This is intended to only ever be used as a side effect of decreasing the reference count to 0.
-
logPremptiveUpdateTableStatistics
public static void logPremptiveUpdateTableStatistics(com.fishlib.io.logger.Logger log) Log the count of created, destroyed, and subscribed PreemptiveUpdatesTables in this worker. -
markSystemic
public void markSystemic()Description copied from interface:SystemicObjectMark this object as systemically important.- Specified by:
markSystemicin interfaceSystemicObject- Overrides:
markSystemicin classBaseTable
-
addSubscription
public boolean addSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int handleId, BitSet columnsToSubscribe, boolean isViewport) Description copied from interface:SubscribableTableAdd a subscription to this table.- Specified by:
addSubscriptionin interfaceSubscribableTable- Parameters:
client- the client requesting the subscription, used to uniquely identify he handleId and send deltas, snapshots and responseshandleId- the ID of our subscriptioncolumnsToSubscribe- the bitset of columns to subscribe toisViewport- true if the subscription is a viewport, false if it is a full subscription- Returns:
- true if the subscription was added
-
updateSubscription
public boolean updateSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, BitSet newSubscribedColumns) Description copied from interface:SubscribableTableUpdate the subscription's columns.- Specified by:
updateSubscriptionin interfaceSubscribableTable- Parameters:
client- the client requesting the subscription, used to send deltas, snapshots and responsessubscriptionId- the ID of our subscriptionnewSubscribedColumns- the bitset of columns to subscribe to- Returns:
- true if the subscription was found and updated
-
updateViewport
public boolean updateViewport(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, Index newViewPort) Description copied from interface:SubscribableTableUpdate the subscription's viewport (rows).- Specified by:
updateViewportin interfaceSubscribableTable- Parameters:
client- the client requesting the subscription, used to send deltas, snapshots and responsessubscriptionId- the ID of our subscriptionnewViewPort- the index representing which rows to subscribe to (in position space)- Returns:
- true if the subscription was found and updated
-
updateViewportAndColumns
public boolean updateViewportAndColumns(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId, Index newViewPort, BitSet columnsToSubscribe) Description copied from interface:SubscribableTableUpdate the subscription's columns and viewport (rows).- Specified by:
updateViewportAndColumnsin interfaceSubscribableTable- Parameters:
client- the client requesting the subscription, used to send deltas, snapshots and responsessubscriptionId- the ID of our subscriptionnewViewPort- the index representing which rows to subscribe to (in position space)columnsToSubscribe- the bitset of columns to subscribe to- Returns:
- true if the subscription was found and updated
-
removeSubscription
public boolean removeSubscription(io.deephaven.enterprise.comm.api.CommandSender client, int subscriptionId) Description copied from interface:SubscribableTableRemove a subscription.- Specified by:
removeSubscriptionin interfaceSubscribableTable- Parameters:
client- the client requesting the subscription, used to send responsessubscriptionId- the ID of our subscription- Returns:
- true if the subscription was found and updated
-
copyPartialColumns
-
setLastNotificationStep
public void setLastNotificationStep(long lastNotificationStep) Description copied from interface:NotificationStepReceiverDeliver a last notification step to this receiver.- Specified by:
setLastNotificationStepin interfaceNotificationStepReceiver- Overrides:
setLastNotificationStepin classBaseTable- Parameters:
lastNotificationStep- The last notification step to be delivered
-
setAttribute
Description copied from interface:TableSet the value of an attribute.- Specified by:
setAttributein interfaceTable- Overrides:
setAttributein classBaseTable- Parameters:
key- the name of the attributeobject- the value
-
getIndex
-
size
public long size()Description copied from interface:LongSizedDataStructureThe size of this data structure.- Specified by:
sizein interfaceLongSizedDataStructure- Returns:
- The size
-
isFlat
public boolean isFlat()Description copied from interface:TableReturn true if this table is guaranteed to be flat. The index of a flat table will be from 0...numRows-1. -
isSnapshot
public boolean isSnapshot()Description copied from interface:SubscribableTableTrue if this table is a snapshot table (as opposed to a preemptive updates table); used byRemoteQueryProcessorto set the isSnapshot flag onExportedTableCreationMessagemessages, so that a client knows if it has an appropriate type of table for its viewport.- Specified by:
isSnapshotin interfaceSubscribableTable- Returns:
- true if this is a subscription snapshot table.
-
sizeForInstrumentation
public long sizeForInstrumentation()- Specified by:
sizeForInstrumentationin interfaceTable
-
preemptiveSnapshotTable
- Specified by:
preemptiveSnapshotTablein interfaceTable- Overrides:
preemptiveSnapshotTablein classWrappedDelegatingTable
-
rollup
public HierarchicalTable rollup(ComboAggregateFactory comboAggregateFactory, boolean includeConstituents, SelectColumn... columns) - Specified by:
rollupin interfaceTable- Overrides:
rollupin classWrappedDelegatingTable- ImplNote:
- The Preemptive version of this method will return a non-preemptive table
-
treeTable
Create a hierarchical tree table. The structure of the table is encoded by an "id" and a "parent" column. The id column should represent a unique identifier for a given row, and the parent column indicates which row is the parent for a given row. Rows that have a null parent, are shown in the main table. It is possible for rows to be "orphaned", if their parent reference is non-null and does not exist in the table.- Specified by:
treeTablein interfaceTable- Overrides:
treeTablein classWrappedDelegatingTable- Parameters:
idColumn- the name of a column containing a unique identifier for a particular row in the tableparentColumn- the name of a column containing the parent's identifier, null for elements that are part of the root table- Returns:
- a hierarchical table grouped according to the parentColumn
- ImplNote:
- The Preemptive version of this method will return a non-preemptive table
-
preemptiveUpdatesTable
- Specified by:
preemptiveUpdatesTablein interfaceTable- Overrides:
preemptiveUpdatesTablein classWrappedDelegatingTable
-
applyPreview
-