Package io.deephaven.barrage.table
Class BarrageTable
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,NotificationQueue.Dependency,Deflatable<Table>,Table,LivenessManager,LivenessNode,LivenessReferent,LongSizedDataStructure,DynamicNode,DynamicTable,NotificationStepReceiver,NotificationStepSource,SystemicObject,BarrageMessage.Listener,Serializable
- Direct Known Subclasses:
BarrageBlinkTable,BarrageRedirectedTable
A client side
Table that mirrors an upstream/server side Table.
Note that viewports are defined in row positions of the upstream table.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic interfaceNested classes/interfaces inherited from class com.illumon.iris.db.v2.QueryTable
QueryTable.FilteredTable, QueryTable.MemoizableOperation, QueryTable.OperationNested 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
FieldsModifier and TypeFieldDescriptionstatic final StringSet this attribute to enable collection of barrage performance stats.protected static final intprotected longthe capacity that the destSources been set tostatic final booleanprotected final WritableSource<?>[]the reinterpreted destination writable sourcesprotected final BarrageTable.StatsFields inherited from class com.illumon.iris.db.v2.QueryTable
modifiedColumnSet, USE_CHUNKED_CROSS_JOIN, USE_UNTRACKED_LASTBY_FOR_AUTOMATED_FILTERSFields 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBarrageTable(LiveTableRegistrar registrar, NotificationQueue notificationQueue, @Nullable ScheduledExecutorService executorService, LinkedHashMap<String, ColumnSource> columns, WritableSource[] writableSources, Map<String, Object> attributes, @Nullable BarrageTable.ViewportChangedCallback viewportChangedCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd this table to the registrar so that it can be refreshed.protected abstract ShiftAwareListener.UpdateapplyUpdates(ArrayDeque<BarrageMessage> localPendingUpdates) protected com.fishlib.io.log.LogEntrybeginLog(@NotNull com.fishlib.io.log.LogLevel level) Convenience method for writing consistent log messages from this object.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.protected voiddoWakeup()@Nullable ObjectgetAttribute(@NotNull String key) Get the value of the specified attribute.protected NotificationQueueGet the notification queue to insert notifications into as they are generated by listeners duringDynamicTable.notifyListeners(Index, Index, Index).booleanClass<?>[]Class<?>[]voidvoidhandleBarrageMessage(BarrageMessage update) protected booleanisSubscribedColumn(int i) static BarrageTablemake(@NotNull LiveTableRegistrar registrar, @NotNull NotificationQueue queue, @Nullable ScheduledExecutorService executor, @NotNull TableDefinition tableDefinition, @NotNull Map<String, Object> attributes, @Nullable BarrageTable.ViewportChangedCallback vpCallback) static BarrageTablemake(@Nullable ScheduledExecutorService executorService, TableDefinition tableDefinition, Map<String, Object> attributes, @Nullable BarrageTable.ViewportChangedCallback vpCallback) Set up a replicated table from the given proxy, id and columns.protected static @NotNull LinkedHashMap<String,ColumnSource> makeColumns(@NotNull List<ColumnDefinition> columns, @NotNull WritableSource<?>[] writableSources, @NotNull RedirectionIndex emptyRowRedirection) Set up the columns for the replicated redirected table.protected static @NotNull LinkedHashMap<String,ColumnSource> makeColumns(List<ColumnDefinition> columns, WritableSource<?>[] writableSources) Set up the columns for the replicated blink table.protected booleanprotected voidrecordMetric(Function<BarrageTable.Stats, org.HdrHistogram.Histogram> hist, long value) protected voidsaveForDebugging(BarrageMessage snapshotOrDelta) protected voidupdateServerViewport(Index viewport, BitSet columns, boolean reverseViewport) Methods inherited from class com.illumon.iris.db.v2.QueryTable
absSumBy, aj, apply, applyToAllBy, avgBy, by, byExternal, copy, copy, countBy, disableParallelWhereForThread, disableWriteReplace, dropColumns, enableWriteReplace, exactJoin, firstBy, flatten, getColumn, getColumnSource, getColumnSourceMap, getColumnSources, getDataIndex, getIndex, getModifiedColumnSetForUpdates, getRecord, getSubTable, getSubTable, head, headBy, headPct, isFlat, join, lastBy, lazyUpdate, leftJoin, maxBy, medianBy, memoizeResult, minBy, naturalJoin, newModifiedColumnSet, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetTransformer, preemptiveSnapshotTable, preemptiveUpdatesTable, preemptiveUpdatesTable, raj, releaseCachedResources, renameColumns, reverse, rollup, select, selectDistinct, setDataIndexProvider, setFlat, setMemoizeResults, silent, size, slice, snapshot, snapshotHistory, snapshotIncremental, sort, stdBy, sumBy, tail, tailBy, tailPct, treeTable, 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, copyAttributes, copyAttributes, createSwapListenerIfRefreshing, getAttributeNames, getAttributes, getDefinition, getDescription, getLastNotificationStep, hasAttribute, initializeWithSnapshot, isAddOnly, isAddOnly, isFailed, isRefreshing, isSystemicObject, layoutHints, listenForDirectUpdates, listenForUpdates, listenForUpdates, markSystemic, notifyListeners, notifyListenersOnError, removeDirectUpdateListener, removeUpdateListener, removeUpdateListener, restrictSortTo, satisfied, setAttribute, setColumnRenderers, setLastNotificationStep, 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, 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, renameAllColumns, renameColumns, renameColumns, rollup, rollup, rollup, rollup, rollup, rollup, rollup, select, select, select, selectDistinct, selectDistinct, selectDistinct, shortColumnIterator, sizeForInstrumentation, 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
-
Field Details
-
DEBUG_ENABLED
public static final boolean DEBUG_ENABLED -
BATCH_SIZE
protected static final int BATCH_SIZE- See Also:
-
BARRAGE_PERFORMANCE_KEY_ATTRIBUTE
Set this attribute to enable collection of barrage performance stats.- See Also:
-
stats
-
capacity
protected long capacitythe capacity that the destSources been set to -
destSources
the reinterpreted destination writable sources
-
-
Constructor Details
-
BarrageTable
protected BarrageTable(LiveTableRegistrar registrar, NotificationQueue notificationQueue, @Nullable @Nullable ScheduledExecutorService executorService, LinkedHashMap<String, ColumnSource> columns, WritableSource[] writableSources, Map<String, Object> attributes, @Nullable @Nullable BarrageTable.ViewportChangedCallback viewportChangedCallback)
-
-
Method Details
-
addSourceToRegistrar
public void addSourceToRegistrar()Add this table to the registrar so that it can be refreshed.- ImplNote:
- this cannot be performed in the constructor as the class is subclassed.
-
applyUpdates
protected abstract ShiftAwareListener.Update applyUpdates(ArrayDeque<BarrageMessage> localPendingUpdates) -
getWireChunkTypes
-
getWireTypes
-
getWireComponentTypes
-
getServerViewport
-
getServerReverseViewport
-
getServerColumns
-
handleBarrageMessage
- Specified by:
handleBarrageMessagein interfaceBarrageMessage.Listener
-
handleBarrageError
- Specified by:
handleBarrageErrorin interfaceBarrageMessage.Listener
-
updateServerViewport
-
isSubscribedColumn
protected boolean isSubscribedColumn(int i) -
getNotificationQueue
Description copied from class:BaseTableGet the notification queue to insert notifications into as they are generated by listeners duringDynamicTable.notifyListeners(Index, Index, Index). This method may be overridden to provide a different notification queue than theLiveTableMonitor.DEFAULTinstance for more complex behavior.- Overrides:
getNotificationQueuein classBaseTable- Returns:
- The
NotificationQueueto add to.
-
make
@InternalUseOnly public static BarrageTable make(@Nullable @Nullable ScheduledExecutorService executorService, TableDefinition tableDefinition, Map<String, Object> attributes, @Nullable @Nullable BarrageTable.ViewportChangedCallback vpCallback) Set up a replicated table from the given proxy, id and columns. This is intended for internal use only.- Parameters:
executorService- an executor service used to flush statstableDefinition- the table definitionattributes- Key-Value pairs of attributes to forward to the QueryTable's metadata- Returns:
- a properly initialized
BarrageTable
-
make
@VisibleForTesting public static BarrageTable make(@NotNull @NotNull LiveTableRegistrar registrar, @NotNull @NotNull NotificationQueue queue, @Nullable @Nullable ScheduledExecutorService executor, @NotNull @NotNull TableDefinition tableDefinition, @NotNull @NotNull Map<String, Object> attributes, @Nullable @Nullable BarrageTable.ViewportChangedCallback vpCallback) -
makeColumns
@NotNull protected static @NotNull LinkedHashMap<String,ColumnSource> makeColumns(@NotNull @NotNull List<ColumnDefinition> columns, @NotNull @NotNull WritableSource<?>[] writableSources, @NotNull @NotNull RedirectionIndex emptyRowRedirection) Set up the columns for the replicated redirected table.- ApiNote:
- emptyRowRedirection must be initialized and empty.
-
makeColumns
@NotNull protected static @NotNull LinkedHashMap<String,ColumnSource> makeColumns(List<ColumnDefinition> columns, WritableSource<?>[] writableSources) Set up the columns for the replicated blink table. -
saveForDebugging
-
maybeEnablePrevTracking
protected boolean maybeEnablePrevTracking() -
doWakeup
protected void doWakeup() -
getAttribute
Description copied from interface:TableGet the value of the specified attribute.- Specified by:
getAttributein interfaceTable- Overrides:
getAttributein classBaseTable- Parameters:
key- the name of the attribute- Returns:
- the value, or null if there was none.
-
beginLog
protected com.fishlib.io.log.LogEntry beginLog(@NotNull @NotNull com.fishlib.io.log.LogLevel level) Convenience method for writing consistent log messages from this object.- Parameters:
level- the log level- Returns:
- a LogEntry
-
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.
-
getDeserializationTmConsumer
-
recordMetric
protected void recordMetric(Function<BarrageTable.Stats, org.HdrHistogram.Histogram> hist, long value)
-