Package com.illumon.iris.db.v2
Class DeferredViewTable
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable
,NotificationQueue.Dependency
,Deflatable<Table>
,Table
,LivenessManager
,LivenessNode
,LivenessReferent
,LongSizedDataStructure
,DynamicNode
,DynamicTable
,NotificationStepReceiver
,NotificationStepSource
,SystemicObject
,Serializable
public class DeferredViewTable extends RedefinableTable
An uncoalesced table with view and where operations to be applied after
UncoalescedTable.coalesce()
is forced.- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DeferredViewTable.SimpleTableReference
static class
DeferredViewTable.TableReference
The table reference hides the table underlying table from us.Nested 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 Modifier and Type Field Description protected String[]
deferredDropColumns
protected SelectFilter[]
deferredFilters
protected SelectColumn[]
deferredViewColumns
Fields inherited from class com.illumon.iris.db.v2.BaseTable
attributes, definition, description, PRINT_SERIALIZED_UPDATE_OVERLAPS, sharedAttributes
Fields inherited from interface com.illumon.iris.db.v2.NotificationStepReceiver
NULL_NOTIFICATION_STEP
Fields 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
Constructors Constructor Description DeferredViewTable(TableDefinition definition, String description, DeferredViewTable.TableReference tableReference, String[] deferredDropColumns, SelectColumn[] deferredViewColumns, SelectFilter[] deferredFilters)
-
Method Summary
Modifier and Type Method Description protected DynamicTable
doCoalesce()
Produce the actual coalesced result table, suitable for caching.void
dropReference()
Drop a previously-retained reference to this referent.WeakReference<? extends LivenessReferent>
getWeakReference()
Get aWeakReference
to this referent.void
initializeTransientFieldsForLiveness()
Package-private forSerializable
sub-classes to use inreadObject
only.protected void
onReferenceCountAtZero()
Callback method that will be invoked when the reference count returns to zero.protected Table
redefine(TableDefinition newDefinition)
Redefine this table with a subset of its current columns.protected Table
redefine(TableDefinition newDefinitionExternal, TableDefinition newDefinitionInternal, SelectColumn[] viewColumns, Map<String,Set<String>> columnDependency)
Redefine this table with a subset of its current columns, with a potentially-differing definition to present to external interfaces and one or more select columns to apply.Table
selectDistinct(SelectColumn... columns)
boolean
tryManage(LivenessReferent referent)
Attempt to add the specified referent to this manager.boolean
tryRetainReference()
If this referent is "live", behave asLivenessReferent.retainReference()
and return true.Table
where(SelectFilter... filters)
Methods inherited from class com.illumon.iris.db.v2.RedefinableTable
dropColumns, renameColumns, updateView, view
Methods inherited from class com.illumon.iris.db.v2.UncoalescedTable
absSumBy, aj, applyToAllBy, avgBy, by, byExternal, coalesce, countBy, exactJoin, firstBy, flatten, getCoalesced, getColumn, getColumnSource, getColumnSourceMap, getColumnSources, getIndex, getRecord, getSubTable, head, headBy, headPct, isFlat, join, lastBy, lazyUpdate, leftJoin, listenForDirectUpdates, listenForUpdates, listenForUpdates, listenForUpdates, listenForUpdatesUncoalesced, maxBy, medianBy, minBy, naturalJoin, preemptiveSnapshotTable, preemptiveUpdatesTable, raj, removeDirectUpdateListener, removeUpdateListener, removeUpdateListener, removeUpdateListenerUncoalesced, reverse, rollup, select, setCoalesced, silent, size, sizeForInstrumentation, slice, snapshot, snapshotHistory, snapshotIncremental, sort, stdBy, sumBy, tail, tailBy, tailPct, treeTable, ungroup, update, updateBy, validateSelect, varBy, wavgBy, whereIn, wouldMatch, wsumBy
Methods inherited from class com.illumon.iris.db.v2.BaseTable
addParentReference, append, awaitUpdate, awaitUpdate, clearSortingRestrictions, copy, copyAttributes, copyAttributes, createSwapListenerIfRefreshing, destroy, getAttribute, getAttributeNames, getAttributes, getDefinition, getDescription, getLastNotificationStep, getNotificationQueue, hasAttribute, initializeWithSnapshot, isAddOnly, isAddOnly, isFailed, isRefreshing, isSystemicObject, layoutHints, markSystemic, notifyListeners, notifyListenersOnError, restrictSortTo, satisfied, setAttribute, setColumnRenderers, setLastNotificationStep, setRefreshing, setTotalsTable, shouldCopyAttribute, toString, withColumnDescription, withKeys, withTableDescription, withUniqueKeys
Methods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifact
manageWithCurrentScope, unmanage, unmanage
Methods inherited from class com.illumon.util.referencecounting.ReferenceCounted
decrementReferenceCount, incrementReferenceCount, resetReferenceCount, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.DynamicTable
newModifiedColumnSet, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetIdentityTransformer, newModifiedColumnSetTransformer, newModifiedColumnSetTransformer, newModifiedColumnSetTransformer, notifyListeners
Methods inherited from interface com.illumon.iris.db.util.liveness.LivenessManager
manage, tryManage
Methods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
Methods inherited from interface com.illumon.iris.db.tables.Table
absSumBy, absSumBy, absSumBy, aj, aj, aj, aj, aj, apply, applyToAllBy, applyToAllBy, applyToAllBy, avgBy, avgBy, avgBy, by, by, by, by, by, by, byExternal, byteColumnIterator, characterColumnIterator, clearSortingRestrictions, close, columnIterator, countBy, countBy, countBy, dateTimeColumnAsNanos, dateTimeColumnAsNanos, deflate, deflate, doubleColumnIterator, dropColumnFormats, dropColumns, exactJoin, exactJoin, exactJoin, exactJoin, firstBy, firstBy, firstBy, floatColumnIterator, formatColumns, formatColumnWhere, formatRowWhere, getAttribute, getAttributeNames, getAttributes, getAttributes, getColumn, getColumns, getColumnSource, getDefinition, getDescription, getMeta, getViewPort, hasAttribute, hasColumns, hasColumns, headBy, headBy, integerColumnIterator, isEmpty, isLive, join, join, join, join, join, join, join, join, join, lastBy, lastBy, lastBy, layoutHints, 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, restrictSortTo, rollup, rollup, rollup, rollup, rollup, rollup, rollup, select, select, select, selectDistinct, selectDistinct, selectDistinct, setAttribute, setColumnRenderers, setTotalsTable, 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, withColumnDescription, withKeys, withTableDescription, withUniqueKeys, wouldMatch, wsumBy, wsumBy, wsumBy
-
Field Details
-
Constructor Details
-
DeferredViewTable
public DeferredViewTable(@NotNull TableDefinition definition, @NotNull String description, @NotNull DeferredViewTable.TableReference tableReference, @Nullable String[] deferredDropColumns, @Nullable SelectColumn[] deferredViewColumns, @Nullable SelectFilter[] deferredFilters)
-
-
Method Details
-
where
- Specified by:
where
in interfaceTable
- Overrides:
where
in classUncoalescedTable
-
doCoalesce
Description copied from class:UncoalescedTable
Produce the actual coalesced result table, suitable for caching.Note that if this table must have listeners registered, etc, setting these up is the implementation's responsibility.
Also note that the implementation should copy attributes, as in
copyAttributes(resultTable, CopyAttributeOperation.Coalesce)
.- Specified by:
doCoalesce
in classUncoalescedTable
- Returns:
- The coalesced result table, suitable for caching
-
selectDistinct
- Specified by:
selectDistinct
in interfaceTable
- Overrides:
selectDistinct
in classUncoalescedTable
-
redefine
Description copied from class:RedefinableTable
Redefine this table with a subset of its current columns.- Specified by:
redefine
in classRedefinableTable
- Parameters:
newDefinition
- A TableDefinition with a subset of this RedefinableTable's ColumnDefinitions.- Returns:
-
redefine
protected Table redefine(TableDefinition newDefinitionExternal, TableDefinition newDefinitionInternal, SelectColumn[] viewColumns, Map<String,Set<String>> columnDependency)Description copied from class:RedefinableTable
Redefine this table with a subset of its current columns, with a potentially-differing definition to present to external interfaces and one or more select columns to apply.- Specified by:
redefine
in classRedefinableTable
- Parameters:
newDefinitionExternal
- A TableDefinition that represents the results of redefine(newDefinitionInternal).view(viewColumns).newDefinitionInternal
- A TableDefinition with a subset of this RedefinableTable's ColumnDefinitions.viewColumns
- A set of SelectColumns to apply in order to transform a table with newDefinitionInternal to a table with newDefinitionExternal.- Returns:
-
initializeTransientFieldsForLiveness
Package-private forSerializable
sub-classes to use inreadObject
only. Public to allow unit tests in another package to work around mock issues where the constructor is never invoked. -
tryRetainReference
public final boolean tryRetainReference()Description copied from interface:LivenessReferent
If this referent is "live", behave asLivenessReferent.retainReference()
and return true. Otherwise, returns false rather than throwing an exception.- Specified by:
tryRetainReference
in interfaceLivenessReferent
- Returns:
- True if this referent was retained, false otherwise
-
dropReference
public final void dropReference()Description copied from interface:LivenessReferent
Drop a previously-retained reference to this referent.- Specified by:
dropReference
in interfaceLivenessReferent
-
getWeakReference
Description copied from interface:LivenessReferent
Get aWeakReference
to this referent. This may be cached, or newly created.- Specified by:
getWeakReference
in interfaceLivenessReferent
- Returns:
- A new or cached reference to this referent
-
tryManage
Description copied from interface:LivenessManager
Attempt to add the specified referent to this manager.- Specified by:
tryManage
in interfaceLivenessManager
- Parameters:
referent
- The referent to add- Returns:
- Whether the referent was in fact added
-
onReferenceCountAtZero
protected final void onReferenceCountAtZero()Description copied from class:ReferenceCounted
Callback method that will be invoked when the reference count returns to zero.- Specified by:
onReferenceCountAtZero
in classReferenceCounted
-