Class RollupTableImpl
java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.liveness.LivenessArtifact
io.deephaven.engine.table.impl.LiveAttributeMap<IFACE_TYPE,IMPL_TYPE>
io.deephaven.engine.table.impl.BaseGridAttributes<IFACE_TYPE,IMPL_TYPE>
io.deephaven.engine.table.impl.hierarchical.HierarchicalTableImpl<RollupTable,RollupTableImpl>
io.deephaven.engine.table.impl.hierarchical.RollupTableImpl
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,AttributeMap<RollupTable>,GridAttributes<RollupTable>,HierarchicalTable<RollupTable>,RollupTable,Serializable
public class RollupTableImpl
extends HierarchicalTableImpl<RollupTable,RollupTableImpl>
implements RollupTable
RollupTable implementation.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
HierarchicalTable.SnapshotStateNested classes/interfaces inherited from interface io.deephaven.engine.table.hierarchical.RollupTable
RollupTable.NodeOperationsRecorder, RollupTable.NodeType -
Field Summary
Fields inherited from interface io.deephaven.engine.table.GridAttributes
COLUMN_DESCRIPTIONS_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, LAYOUT_HINTS_ATTRIBUTE, SORTABLE_COLUMNS_ATTRIBUTEFields inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
KEY_TABLE_ACTION_CONTRACT, KEY_TABLE_ACTION_EXPAND, KEY_TABLE_ACTION_EXPAND_ALL -
Method Summary
Modifier and TypeMethodDescriptionprotected RollupTableImplcopy()Create a copy ofthiswith initially-sharedLiveAttributeMap.mutableAttributes.Collection<? extends Aggregation>Get the aggregations for therollupoperation.List<ColumnDefinition<?>>Get thedefinitionsfor all available columns that may be requested in a snapshot.Get a description of this HierarchicalTable.Get a re-usable, static keyTablewith zero rows that will cause a snapshot to expand only the default nodes.Collection<? extends ColumnName>Get the group-by columns for therollupoperation.getNodeDefinition(@NotNull RollupTable.NodeType nodeType) Get theTableDefinitionthat should be exposed to node table consumers, e.g.booleanAre the source table's constituent rows included at the lowest level of the rollup?static WhereFilter[]initializeAndValidateFilters(@NotNull Table source, @NotNull Collection<? extends Aggregation> aggregations, @NotNull Collection<? extends Filter> filters, @NotNull Function<String, ? extends RuntimeException> exceptionFactory) Initialize and validate the supplied filters for this RollupTable.static RollupTablemakeFromPartsInternal(@NotNull QueryTable source, @NotNull Map<String, Object> attributes, @NotNull Collection<? extends Aggregation> aggregations, @NotNull Collection<? extends ColumnName> groupByColumns, @NotNull QueryTable[] levelTables, @NotNull AggregationRowLookup[] levelRowLookups, @NotNull ColumnSource<Table>[] levelNodeTableSources) Create a RollupTable from internal data structures that have been made outside the rollup code.io.deephaven.engine.table.impl.hierarchical.RollupNodeOperationsRecordermakeNodeOperationsRecorder(@NotNull RollupTable.NodeType nodeType) Get arecorderfor per-node operations to apply during snapshots of the requestedRollupTable.NodeType.static RollupTablemakeRollup(@NotNull QueryTable source, @NotNull Collection<? extends Aggregation> aggregations, boolean includeConstituents, @NotNull Collection<? extends ColumnName> groupByColumns) Create a new RollupTable based onnewSource, inheriting this RollupTable'saggregations,constituent inclusion,group-by columns,node operations, andfilters.translateAggregatedNodeOperationsForConstituentNodes(@NotNull RollupTable.NodeOperationsRecorder aggregatedNodeOperationsToTranslate) Translate node operations for aggregated nodes to the closest equivalent for a constituent node.withFilter(@NotNull Filter filter) Apply a filter to the source table for this RollupTable before applying the rollup operation.withNodeOperations(@NotNull RollupTable.NodeOperationsRecorder... nodeOperations) Get a new RollupTable that will apply therecordedoperations to nodes when gathering snapshots.withUpdateView(@NotNull String... columns) Apply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.withUpdateView(Collection<Selectable> columns) Apply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.Methods inherited from class io.deephaven.engine.table.impl.hierarchical.HierarchicalTableImpl
checkAvailableColumns, checkRebaseDefinition, getRoot, getRowDepthColumn, getRowExpandedColumn, getSource, getStructuralColumnDefinitions, makeSnapshotState, snapshotMethods inherited from class io.deephaven.engine.table.impl.BaseGridAttributes
clearSortingRestrictions, getSortableColumns, restrictSortTo, setColumnDescriptions, setLayoutHints, setSortableColumns, withColumnDescription, withColumnDescriptions, withDescriptionMethods inherited from class io.deephaven.engine.table.impl.LiveAttributeMap
copyAttributes, getAttribute, getAttributeKeys, getAttributes, getAttributes, hasAttribute, prepareReturnCopy, prepareReturnThis, published, retainingAttributes, setAttribute, setAttribute, withAttributes, withAttributes, withoutAttributesMethods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScopeMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.AttributeMap
getAttribute, getAttributeKeys, getAttributes, getAttributes, hasAttribute, retainingAttributes, withAttributes, withAttributes, withoutAttributesMethods inherited from interface io.deephaven.engine.table.GridAttributes
clearSortingRestrictions, restrictSortTo, setLayoutHints, withColumnDescription, withColumnDescriptions, withDescriptionMethods inherited from interface io.deephaven.engine.table.hierarchical.HierarchicalTable
getRoot, getRowDepthColumn, getRowExpandedColumn, getSource, getStructuralColumnDefinitions, makeSnapshotState, snapshotMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface io.deephaven.engine.table.hierarchical.RollupTable
getLeafNodeType
-
Method Details
-
getAggregations
Description copied from interface:RollupTableGet the aggregations for therollupoperation.- Specified by:
getAggregationsin interfaceRollupTable- Returns:
- The rollup aggregations
-
includesConstituents
public boolean includesConstituents()Description copied from interface:RollupTableAre the source table's constituent rows included at the lowest level of the rollup?- Specified by:
includesConstituentsin interfaceRollupTable- Returns:
- Whether constituents are included
-
getGroupByColumns
Description copied from interface:RollupTableGet the group-by columns for therollupoperation.- Specified by:
getGroupByColumnsin interfaceRollupTable- Returns:
- The group-by columns
-
getDescription
Description copied from interface:HierarchicalTableGet a description of this HierarchicalTable.- Specified by:
getDescriptionin interfaceHierarchicalTable<RollupTable>- Returns:
- The description
-
getEmptyExpansionsTable
Description copied from interface:HierarchicalTableGet a re-usable, static keyTablewith zero rows that will cause a snapshot to expand only the default nodes.- Specified by:
getEmptyExpansionsTablein interfaceHierarchicalTable<RollupTable>- Returns:
- An empty key
Tablefor default expansions
-
getNodeDefinition
Description copied from interface:RollupTableGet theTableDefinitionthat should be exposed to node table consumers, e.g. UI-driven snapshots. This excludes "internal" columns used to organize the rollup or support operations, as well as therow-depth columnandrow-expanded column, but includes formatting columns.- Specified by:
getNodeDefinitionin interfaceRollupTable- Parameters:
nodeType- Thenode typeto get theTableDefinitionfor- Returns:
- The externally-visible node
TableDefinitionfor the requestednodeType
-
getAvailableColumnDefinitions
Description copied from interface:HierarchicalTableGet thedefinitionsfor all available columns that may be requested in a snapshot.The result will always begin with the
structural columns, which are then followed by type-specific node-level columns.- Specified by:
getAvailableColumnDefinitionsin interfaceHierarchicalTable<RollupTable>- Returns:
- A list of
definitionsfor all available columns that may be requested in a snapshot
-
withFilter
Description copied from interface:RollupTableApply a filter to the source table for this RollupTable before applying the rollup operation. This filter must use only non-aggregate columns and must not use column arrays.- Specified by:
withFilterin interfaceRollupTable- Parameters:
filter- The filter to apply; must only reference non-aggregate columns and must not use column arrays- Returns:
- The new RollupTable
-
withUpdateView
Description copied from interface:RollupTableApply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.- Specified by:
withUpdateViewin interfaceRollupTable- Parameters:
columns- The new columns to add- Returns:
- The new RollupTable
-
withUpdateView
Description copied from interface:RollupTableApply a view to this RollupTable in order to produce a new RollupTable with additional columns at the aggregated node level.- Specified by:
withUpdateViewin interfaceRollupTable- Parameters:
columns- The new columns to add- Returns:
- The new RollupTable
-
initializeAndValidateFilters
public static WhereFilter[] initializeAndValidateFilters(@NotNull @NotNull Table source, @NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<? extends Filter> filters, @NotNull @NotNull Function<String, ? extends RuntimeException> exceptionFactory) Initialize and validate the supplied filters for this RollupTable.- Parameters:
source- The rollupsourceaggregations- The rollup aggregations}filters- The filters to initialize and validateexceptionFactory- A factory for creating exceptions from their messages- Returns:
- The initialized and validated filters
-
makeNodeOperationsRecorder
public io.deephaven.engine.table.impl.hierarchical.RollupNodeOperationsRecorder makeNodeOperationsRecorder(@NotNull @NotNull RollupTable.NodeType nodeType) Description copied from interface:RollupTableGet arecorderfor per-node operations to apply during snapshots of the requestedRollupTable.NodeType.- Specified by:
makeNodeOperationsRecorderin interfaceRollupTable- Parameters:
nodeType- Thenode typethat operations will be applied to- Returns:
- The new recorder
-
withNodeOperations
public RollupTable withNodeOperations(@NotNull @NotNull RollupTable.NodeOperationsRecorder... nodeOperations) Description copied from interface:RollupTableGet a new RollupTable that will apply therecordedoperations to nodes when gathering snapshots. Operations will be applied only to thenode typesupplied when the elements ofnodeOperationswere initiallycreated.- Specified by:
withNodeOperationsin interfaceRollupTable- Parameters:
nodeOperations- The node-level operations to apply. Elements must have been initially supplied byRollupTable.makeNodeOperationsRecorder(NodeType)fromthisRollupTable.- Returns:
- The new RollupTable
-
translateAggregatedNodeOperationsForConstituentNodes
public RollupTable.NodeOperationsRecorder translateAggregatedNodeOperationsForConstituentNodes(@NotNull @NotNull RollupTable.NodeOperationsRecorder aggregatedNodeOperationsToTranslate) Description copied from interface:RollupTableTranslate node operations for aggregated nodes to the closest equivalent for a constituent node. May only be invoked ifincludesConstituents() == true.- Specified by:
translateAggregatedNodeOperationsForConstituentNodesin interfaceRollupTable- Parameters:
aggregatedNodeOperationsToTranslate- Node-level operations for aggregated nodes, initially supplied bymakeNodeOperationsRecorder(NodeType.Aggregated).- Returns:
- Node-level operations for constituent nodes
-
copy
Description copied from class:LiveAttributeMapCreate a copy ofthiswith initially-sharedLiveAttributeMap.mutableAttributes.- Specified by:
copyin classLiveAttributeMap<RollupTable,RollupTableImpl>
-
rebase
Description copied from interface:RollupTableCreate a new RollupTable based onnewSource, inheriting this RollupTable'saggregations,constituent inclusion,group-by columns,node operations, andfilters.- Specified by:
rebasein interfaceRollupTable- Parameters:
newSource- A new source table that must have the same definition as the source of this rollup; that isnewSource.getDefinition().equals(getSource().getDefinition())must betrue- Returns:
- The new RollupTable
-
makeRollup
public static RollupTable makeRollup(@NotNull @NotNull QueryTable source, @NotNull @NotNull Collection<? extends Aggregation> aggregations, boolean includeConstituents, @NotNull @NotNull Collection<? extends ColumnName> groupByColumns) -
makeFromPartsInternal
@InternalUseOnly public static RollupTable makeFromPartsInternal(@NotNull @NotNull QueryTable source, @NotNull @NotNull Map<String, Object> attributes, @NotNull @NotNull Collection<? extends Aggregation> aggregations, @NotNull @NotNull Collection<? extends ColumnName> groupByColumns, @NotNull @NotNull QueryTable[] levelTables, @NotNull @NotNull AggregationRowLookup[] levelRowLookups, @NotNull @NotNull ColumnSource<Table>[] levelNodeTableSources) Create a RollupTable from internal data structures that have been made outside the rollup code.
Constituents may not be included, and node operations are not provided.
Note: This function is not part of the public Deephaven API, and the semantics are subject to change at any time.
- Parameters:
source- the original table being aggregated for this rollupattributes- the attributes of the result rollupaggregations- the aggregations used to make this rollupgroupByColumns- the group by columns for this rolluplevelTables- an array of tables for each levellevelRowLookups- an array of row lookup structures for each levellevelNodeTableSources- an array of column sources containing a lower-level table- Returns:
- a RollupTable from the provided data structures
-