Package io.deephaven.web.client.api
Class JsTable
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.lifecycle.HasLifecycle
io.deephaven.web.client.api.JsTable
- All Implemented Interfaces:
JoinableTable,JsITable,ServerObject,HasTableBinding,Revivable
@TsName(namespace="dh",
name="Table")
public class JsTable
extends HasLifecycle
implements HasTableBinding, JoinableTable, ServerObject, JsITable, Revivable
Provides access to data in a table. Note that several methods present their response through Promises. This allows
the client to:
- Avoid actually connecting to the server until necessary.
- Permit some changes not to inform the UI right away that they have taken place.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfaceNested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T>Nested classes/interfaces inherited from interface io.deephaven.web.client.api.ServerObject
ServerObject.Union -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIndicates that columns for this table have changed, and column headers should be updated.static final StringThis table has lost its connection to the server.static final StringIndicates that a filter has occurred, and that the UI should be replaced with the current viewport.static final StringThis table has reconnected to the server, and data will update again.static final StringThis table could not be re-established after a reconnect and cannot be used again; fetch a new one.static final StringIndicates that an error occurred on this table on the server or while communicating with it.static final StringIndicates that a pending change to this table, such as a new sort or filter, was applied on the server.static final StringFiner grained visibility into data being added, rather than just seeing the currently visible viewport.static final StringFiner grained visibility into data being removed, rather than just seeing the currently visible viewport.static final StringFiner grained visibility into data being updated, rather than just seeing the currently visible viewport.static final StringThe table size has updated, so live scrollbars and the like can be updated accordingly.static final StringIndicates that a sort has occurred, and that the UI should be replaced with the current viewport.static final Stringevent.detailis the currently visible window, the same as ifgetViewportDatawas called and resolved.static final Stringstatic final Stringstatic final intstatic final doubleThe size the table will have if it is uncoalesced.Fields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED -
Constructor Summary
ConstructorsConstructorDescriptionJsTable(WorkerConnection workerConnection, ClientTableState state) Creates a newTabledirectly from an existingClientTableState(CTS). -
Method Summary
Modifier and TypeMethodDescriptionelemental2.core.JsArray<CustomColumn> applyCustomColumns(elemental2.core.JsArray<JsTable.CustomColumnArgUnionType> customColumns) Used when adding new filter and sort operations to the table, as long as they are present.elemental2.core.JsArray<FilterCondition> applyFilter(FilterCondition[] filter) Replace the currently set filters on the table.elemental2.core.JsArray<Sort> Replace the currently set sort on this table.elemental2.promise.Promise<JsTable> asOfJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsNullable String asOfMatchRule) Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching row from the right table.elemental2.promise.Promise<JsTable> batch(JsConsumer<RequestBatcher> userCode) elemental2.promise.Promise<JsPartitionedTable> byExternal(Object keys, @JsNullable Boolean dropKeys) Alias forpartitionBy(Object, Boolean).voidclose()Signals that the table is no longer used, so the server can release its resources.elemental2.promise.Promise<JsTable> copy()Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.elemental2.promise.Promise<JsTable> copy(boolean resolved) elemental2.promise.Promise<TableData> createSnapshot(@TsTypeRef(SnapshotOptions.class) Object options) Returns a promise of aTableDatainstance containing a snapshot of the current state of the table, within the bounds of the specified rows and columns.createSubscription(@TsTypeRef(SubscriptionOptions.class) Object options) Creates a subscription to the specified columns, across all rows in the table.createViewportSubscription(@TsTypeRef(ViewportSubscriptionOptions.class) Object options) Creates a viewport subscription to the specified columns, across the specified rows in the table.elemental2.promise.Promise<JsTable> crossJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsNullable Double reserveBits) A promise that will be resolved with the newly created table holding the results of the specified cross join operation.elemental2.promise.Promise<JsTable> downsample(LongWrapper[] zoomRange, int pixelCount, String xCol, String[] yCols) Get a downsampled version of the table.elemental2.promise.Promise<JsTable> exactJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd) A promise that will be resolved with the newly created table holding the results of the specified exact join operation.findColumn(String key) Retrieve a column by the given name.Column[]findColumns(String[] keys) Retrieve multiple columns specified by the given names.elemental2.promise.Promise<JsTable> freeze()A "frozen" version of this table (a server-side snapshot of the entire source table).@JsNullable ObjectgetAttribute(String attributeName) Reads an attribute's value as a string.elemental2.core.JsArray<String> The names of all attributes defined on this table.getCache()elemental2.core.JsArray<Column> The columns that are present on this table.elemental2.promise.Promise<JsColumnStatistics> Computes statistics for one column of this table, such as its count, sum and average for a numeric column, or its most common values for other types.elemental2.core.JsArray<CustomColumn> An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones.@JsNullable StringThe table description attribute.elemental2.core.JsArray<FilterCondition> An ordered list of filter conditions to apply to the table.elemental2.promise.Promise<JsTotalsTable> getGrandTotalsTable(@JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) A promise that will resolve to a Totals Table of this table, ignoring any filters.@JsNullable JsLayoutHintsLayout hints for displaying this table.@JsNullable StringThe plugin name attribute for this table.doublegetSize()The total count of rows in the table.elemental2.core.JsArray<Sort> getSort()An ordered list ofSorts to apply to the table.intdoubleThe total count of the rows in the table, excluding any filters.elemental2.promise.Promise<JsTotalsTable> getTotalsTable(@JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) A promise that will resolve to a Totals Table of this table.The default configuration to be used when building adh.TotalsTablefor this table.elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData> Deprecated.booleanhasHandle(TableTicket tableHandle) booleantrueif this table represents a user Input Table (seedh.InputTable).booleanhasRollbackHandle(TableTicket tableHandle) elemental2.promise.Promise<JsInputTable> IfhasInputTable()istrue, you may call this method to gain access to anJsInputTableobject which can be used to mutate the data within the table.booleanisActive(ClientTableState state) booleanisAlive()booleanChecks whether this table is a blink table.booleanisClosed()trueif this table has been closed.booleantrueif this table may receive updates from the server, including size changed events, updated events after initial snapshot.booleanRead-only.elemental2.promise.Promise<JsTable> join(String joinType, JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsNullable String asOfMatchRule) Deprecated.Returns the current state if active, or the last state which was active which represents the state we will return to if an error occurs with the state we're presently waiting on.voidmaybeRevive(ClientTableState state) voidelemental2.promise.Promise<JsTable> naturalJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd) A promise that will be resolved with the newly created table holding the results of the specified natural join operation.This table's server-side state as it is now, as a pending table to chain operations on.elemental2.promise.Promise<JsPartitionedTable> partitionBy(Object keys, @JsNullable Boolean dropKeys) Creates a newdh.PartitionedTablefrom the contents of the current table, partitioning data based on the specified keys.elemental2.promise.Promise<JsTable> refetch()Indicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible.static Sortreverse()ASortthat can be used to reverse a table.voidrevive(ClientTableState state) voidrollback()elemental2.promise.Promise<JsTreeTable> rollup(@TsTypeRef(JsRollupConfig.class) Object configObject) a promise that will resolve to a new roll-updh.TreeTableof this table.elemental2.promise.Promise<Double> seekRow(double startingRow, Column.ColumnOrName column, @TsTypeRef(ValueType.class) String valueType, jsinterop.base.Any seekValue, @JsNullable Boolean insensitive, @JsNullable Boolean contains, @JsNullable Boolean isBackwards) Finds the next row, afterstartingRowand wrapping around, whose value incolumnmatchesseekValue.elemental2.promise.Promise<JsTable> selectDistinct(Column[] columns) A new table containing the distinct tuples of values from the given columns that are present in the original table.selectDistinct(Column[] columns, TableTicket handle) AsselectDistinct(Column[]), into a ticket the caller allocated earlier.voidsetRollback(ActiveTableBinding rollbackTo) voidsetSize(double s) voidsetState(ClientTableState state) setViewport(double firstRow, double lastRow) Overload for Java (since JS just omits the optional params).setViewport(double firstRow, double lastRow, @JsNullable elemental2.core.JsArray<Column> columns, @JsNullable Double updateIntervalMs, @JsNullable Boolean isReverseViewport) Deprecated.UsecreateViewportSubscription(Object)instead.setViewport(double firstRow, double lastRow, elemental2.core.JsArray<Column> columns) Overload for Java (since JS just omits the optional param).elemental2.promise.Promise<JsTable> snapshot(JsTableReference baseTable, @JsNullable Boolean doInitialSnapshot, @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> stampColumns) Creates a server-side snapshot ofbaseTablewhen this table updates.state()Overload for java (since js just omits the optional var)Deprecated.UsecreateSubscription(Object)with aDataOptions.SubscriptionOptionsinstead.toString()Gets a string representation of this table instance.elemental2.promise.Promise<JsTreeTable> treeTable(@TsTypeRef(JsTreeTableConfig.class) Object configObject) A promise that will resolve to a newdh.TreeTableof this table.Methods inherited from class io.deephaven.web.client.api.lifecycle.HasLifecycle
die, disconnected, nextReconnect, reconnectMethods inherited from class io.deephaven.web.client.api.event.HasEventHandling
addEventListener, addEventListenerOneShot, addEventListenerOneShot, failureHandled, fireCriticalEvent, fireCriticalEvent, fireEvent, fireEvent, fireEvent, hasListener, hasListeners, isSuppress, logPrefix, nextEvent, removeEventListener, suppressEvents, unsuppressEventsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.web.client.state.HasTableBinding
fireEvent, fireEvent
-
Field Details
-
EVENT_SIZECHANGED
The table size has updated, so live scrollbars and the like can be updated accordingly.- See Also:
-
EVENT_UPDATED
event.detailis the currently visible window, the same as ifgetViewportDatawas called and resolved. Listening to this event removes the need to listen to the finer grained events below for data changes. In contrast, using the finer grained events may enable only updating the specific rows which saw a change.- See Also:
-
EVENT_ROWADDED
Finer grained visibility into data being added, rather than just seeing the currently visible viewport. Provides the row being added, and the offset it will exist at.- See Also:
-
EVENT_ROWREMOVED
Finer grained visibility into data being removed, rather than just seeing the currently visible viewport. Provides the row being removed, and the offset it used to exist at.- See Also:
-
EVENT_ROWUPDATED
Finer grained visibility into data being updated, rather than just seeing the currently visible viewport. Provides the row being updated and the offset it exists at.- See Also:
-
EVENT_SORTCHANGED
Indicates that a sort has occurred, and that the UI should be replaced with the current viewport.- See Also:
-
EVENT_FILTERCHANGED
Indicates that a filter has occurred, and that the UI should be replaced with the current viewport.- See Also:
-
EVENT_CUSTOMCOLUMNSCHANGED
Indicates that columns for this table have changed, and column headers should be updated.- See Also:
-
EVENT_DISCONNECT
This table has lost its connection to the server. Events will not fire and data will not update until the connection is reestablished, at which pointEVENT_RECONNECTwill fire, orEVENT_RECONNECTFAILEDif this table cannot be re-established. A reconnect will be attempted automatically. Subscriptions made from this table report their own lifecycle with the same event names.- See Also:
-
EVENT_RECONNECT
This table has reconnected to the server, and data will update again. Any viewport or subscription that was active before the disconnect has been re-requested; its data follows inupdatedevents on the object it was subscribed through, this table or the subscription.- See Also:
-
EVENT_RECONNECTFAILED
This table could not be re-established after a reconnect and cannot be used again; fetch a new one. Theevent.detailvalue describes the failure. This says nothing about the connection as a whole: other tables may have reconnected.- See Also:
-
EVENT_REQUEST_FAILED
Indicates that an error occurred on this table on the server or while communicating with it. The message will provide more insight, but recent operations were likely unsuccessful and may need to be reapplied.- See Also:
-
EVENT_REQUEST_SUCCEEDED
Indicates that a pending change to this table, such as a new sort or filter, was applied on the server. AnyEVENT_SORTCHANGED,EVENT_FILTERCHANGED, orEVENT_CUSTOMCOLUMNSCHANGEDresulting from that change fires after this event.- See Also:
-
SIZE_UNCOALESCED
@JsProperty(namespace="dh.Table") public static final double SIZE_UNCOALESCEDThe size the table will have if it is uncoalesced.- See Also:
-
INTERNAL_EVENT_STATECHANGED
- See Also:
-
INTERNAL_EVENT_SIZELISTENER
- See Also:
-
MAX_BATCH_TIME
public static final int MAX_BATCH_TIME- See Also:
-
-
Constructor Details
-
JsTable
Creates a newTabledirectly from an existingClientTableState(CTS). The CTS manages all fetch operations, so this is just a simple constructor to get a table that points to the given state.
-
-
Method Details
-
reverse
ASortthat can be used to reverse a table. This can be passed into an array in applySort. Note that Tree Tables do not supportreverse.- Returns:
Sort
-
refetch
Description copied from class:HasLifecycleIndicate that a new session has been created on the server, and this object should re-create its corresponding server-side object if possible. Override this to implement custom behavior, being sure to call reconnect() when finished.- Overrides:
refetchin classHasLifecycle- Returns:
- a promise that will resolve when this object is reconnected
-
typedTicket
- Specified by:
typedTicketin interfaceServerObject
-
operations
This table's server-side state as it is now, as a pending table to chain operations on. Like everyTableOperations, it stands for one fixed table: a laterapplyFilter(io.deephaven.web.client.api.filter.FilterCondition[]),applySort(io.deephaven.web.client.api.Sort[])or other change to this table does not move it; calloperations()again to build on the changed table. Like any pending table, it can only be used in the task that created it; await orresolve()it to keep the table longer, as aJsResolvedTableto close when done. This table is unaffected by anything done with it.- Returns:
- a pending table over this table's current state
- Throws:
IllegalStateException- if this table is closed
-
findColumn
Retrieve a column by the given name. You should prefer to always retrieve a newColumninstance instead of caching a returned value.- Specified by:
findColumnin interfaceJsITable- Parameters:
key-- Returns:
Column
-
findColumns
Retrieve multiple columns specified by the given names.- Parameters:
keys-- Returns:
Columnarray
-
lastVisibleState
Returns the current state if active, or the last state which was active which represents the state we will return to if an error occurs with the state we're presently waiting on. This lets user code access the last known table size and columns. -
isAlive
public boolean isAlive()- Specified by:
isAlivein interfaceHasTableBinding
-
state
- Specified by:
statein interfaceHasTableBinding- Specified by:
statein interfaceJoinableTable
-
hasInputTable
@JsProperty(name="hasInputTable") public boolean hasInputTable()trueif this table represents a user Input Table (seedh.InputTable). Whentrue, you may callinputTable()to add or remove data from the underlying table. -
isBlinkTable
@JsMethod public boolean isBlinkTable()Checks whether this table is a blink table.- Returns:
trueif this table is a blink table;falseotherwise.
-
inputTable
IfhasInputTable()istrue, you may call this method to gain access to anJsInputTableobject which can be used to mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected. -
close
@JsMethod public void close()Description copied from interface:JsITableSignals that the table is no longer used, so the server can release its resources. Logs a warning if called more than once. -
getAttributes
Description copied from interface:JsITableThe names of all attributes defined on this table.- Specified by:
getAttributesin interfaceJsITable- Returns:
- an array of attributes defined on this table
-
getAttribute
Description copied from interface:JsITableReads an attribute's value as a string. Only primitive and string values are sent to the client. An attribute listed byJsITable.getAttributes()with any other value cannot be read here.- Specified by:
getAttributein interfaceJsITable- Parameters:
attributeName- the name of the attribute to read- Returns:
- the value of the attribute or null if none with that name exists
-
getColumns
The columns that are present on this table. This is always all possible columns. If you specify fewer columns insetViewport(double, double, JsArray), you will get only those columns in yourViewportData.- Specified by:
getColumnsin interfaceJsITable- Returns:
- the columns in this table
-
getLayoutHints
Layout hints for displaying this table. -
getSize
@JsProperty public double getSize()The total count of rows in the table. If there is a viewport subscription active, this size will be updated when the subscription updates. If not, andisUncoalesced()is true, the size will beSIZE_UNCOALESCED. Otherwise, the size will be updated when the server's update graph processes changes.When the size changes, the
EVENT_SIZECHANGEDevent will be fired. -
getDescription
The table description attribute.- Returns:
- The description, or
null.
-
getTotalSize
@JsProperty public double getTotalSize()The total count of the rows in the table, excluding any filters. UnlikegetSize(), changes to this value will not result in any event. If the table is unfiltered, this will return the same size asgetSize(). If this table was uncoalesced before it was filtered, this will returnSIZE_UNCOALESCED. -
getSort
An ordered list ofSorts to apply to the table. To update, callapplySort(Sort[]). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for theEVENT_SORTCHANGEDevent to know when to update the UI. -
getFilter
An ordered list of filter conditions to apply to the table. To update, callapplyFilter(FilterCondition[]). Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for theEVENT_FILTERCHANGEDevent to know when to update the UI. -
applySort
Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will immediately return the new value, but you may receive update events using the old sort before the new sort is applied, and theEVENT_SORTCHANGEDevent fires. Reusing existing, applied sorts may enable this to perform better on the server. TheEVENT_UPDATEDevent will also fire, butEVENT_ROWADDEDandEVENT_ROWREMOVEDwill not.- Parameters:
sort-
-
applyFilter
Replace the currently set filters on the table. Returns the previously set value. Note that the filter property will immediately return the new value, but you may receive update events using the old filter before the new one is applied, and theEVENT_FILTERCHANGEDevent fires. Reusing existing, applied filters may enable this to perform better on the server. TheEVENT_UPDATEDevent will also fire, butEVENT_ROWADDEDandEVENT_ROWREMOVEDwill not.- Parameters:
filter-
-
applyCustomColumns
@JsMethod public elemental2.core.JsArray<CustomColumn> applyCustomColumns(elemental2.core.JsArray<JsTable.CustomColumnArgUnionType> customColumns) Used when adding new filter and sort operations to the table, as long as they are present.- Parameters:
customColumns-
-
getCustomColumns
An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones. To update, callapplyCustomColumns(JsArray). -
setViewport
Overload for Java (since JS just omits the optional params). -
setViewport
public TableViewportSubscription setViewport(double firstRow, double lastRow, elemental2.core.JsArray<Column> columns) Overload for Java (since JS just omits the optional param). -
setViewport
@JsMethod @Deprecated public TableViewportSubscription setViewport(double firstRow, double lastRow, @JsOptional @JsNullable elemental2.core.JsArray<Column> columns, @JsOptional @JsNullable Double updateIntervalMs, @JsOptional @JsNullable Boolean isReverseViewport) Deprecated.UsecreateViewportSubscription(Object)instead.If the columns parameter is not provided, all columns will be used. If theupdateIntervalMsparameter is not provided, a default of one second will be used. Until this is called, no data will be available. Invoking this will result in events to be fired once data becomes available, starting with anupdatedevent and arowaddedevent per row in that range. The returned object allows the viewport to be closed when no longer needed.- Parameters:
firstRow-lastRow-columns-updateIntervalMs-
-
getViewportData
@JsMethod @Deprecated public elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData> getViewportData()Deprecated.useTableViewportSubscription.getViewportData()on the result fromcreateViewportSubscription(Object)instead.Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to separate the lifespan of this promise from the table itself, callTableViewportSubscription.getViewportData()on the result fromsetViewport(double, double).- Returns:
- Promise of
TableData
-
subscribe
Overload for java (since js just omits the optional var) -
subscribe
@JsMethod @Deprecated public TableSubscription subscribe(elemental2.core.JsArray<Column> columns, @JsOptional @JsNullable Double updateIntervalMs) Deprecated.UsecreateSubscription(Object)with aDataOptions.SubscriptionOptionsinstead.Creates a subscription to the specified columns, across all rows in the table. The optional parameterupdateIntervalMsmay be specified to indicate how often the server should send updates, defaulting to one second if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call to subscribe creates a new subscription, which must haveAbstractTableSubscription.close()called on it to stop it, and all events are fired from theTableSubscriptioninstance.- Parameters:
columns-updateIntervalMs-
-
createSubscription
@JsMethod public TableSubscription createSubscription(@TsTypeRef(SubscriptionOptions.class) @TsTypeRef(SubscriptionOptions.class) Object options) Description copied from interface:JsITableCreates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a snapshot of the table atomically. The initial snapshot arrives in a single event, and later changes arrive as updates. However, this may still be very expensive to run from a browser for very large tables. Each call creates a new subscription, which must haveAbstractTableSubscription.close()called on it to stop it and release its resources, and all events are fired from theTableSubscriptioninstance.- Specified by:
createSubscriptionin interfaceJsITable- Parameters:
options- the subscription options, described inDataOptions.SubscriptionOptions- Returns:
- a new
TableSubscription
-
createViewportSubscription
@JsMethod public TableViewportSubscription createViewportSubscription(@TsTypeRef(ViewportSubscriptionOptions.class) @TsTypeRef(ViewportSubscriptionOptions.class) Object options) Description copied from interface:JsITableCreates a viewport subscription to the specified columns, across the specified rows in the table. The returnedTableViewportSubscriptioninstance allows the viewport to be changed over time, and events are fired from it when the data changes or when a viewport change is applied. Each call creates a new subscription, which must haveTableViewportSubscription.close()called on it to stop it and release its resources.- Specified by:
createViewportSubscriptionin interfaceJsITable- Parameters:
options- the viewport subscription options, described inDataOptions.ViewportSubscriptionOptions- Returns:
- a new
TableViewportSubscription
-
createSnapshot
@JsMethod public elemental2.promise.Promise<TableData> createSnapshot(@TsTypeRef(SnapshotOptions.class) @TsTypeRef(SnapshotOptions.class) Object options) Description copied from interface:JsITableReturns a promise of aTableDatainstance containing a snapshot of the current state of the table, within the bounds of the specified rows and columns.- Specified by:
createSnapshotin interfaceJsITable- Parameters:
options- the snapshot options, described inDataOptions.SnapshotOptions- Returns:
- a promise of
TableData
-
selectDistinct
A new table containing the distinct tuples of values from the given columns that are present in the original table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the order of appearance of values from the original table.- Parameters:
columns-- Returns:
- a promise of the distinct table
-
selectDistinct
AsselectDistinct(Column[]), into a ticket the caller allocated earlier. -
copy
Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport. The copy is of this table as it is now, and must be closed when no longer needed. To chain operations on this table instead, useoperations().- Returns:
- Promise of dh.Table
-
copy
-
getTotalsTable
@JsMethod public elemental2.promise.Promise<JsTotalsTable> getTotalsTable(@JsOptional @TsTypeRef(JsTotalsTableConfig.class) @JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) A promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as a parameter, or will use the table's default if no parameter is provided, and be updated once per second as necessary. Note that multiple calls to this method will each produce a newdh.TotalsTablewhich must haveclose()called on it when not in use.- Parameters:
config-- Returns:
- Promise of dh.TotalsTable
-
getTotalsTableConfig
The default configuration to be used when building adh.TotalsTablefor this table.- Returns:
dh.TotalsTableConfig
-
getGrandTotalsTable
@JsMethod public elemental2.promise.Promise<JsTotalsTable> getGrandTotalsTable(@JsOptional @TsTypeRef(JsTotalsTableConfig.class) @JsNullable @TsTypeRef(JsTotalsTableConfig.class) Object config) A promise that will resolve to a Totals Table of this table, ignoring any filters. SeegetTotalsTable(Object)for more specifics.- Parameters:
config-- Returns:
- promise of
dh.TotalsTable
-
rollup
@JsMethod public elemental2.promise.Promise<JsTreeTable> rollup(@TsTypeRef(JsRollupConfig.class) @TsTypeRef(JsRollupConfig.class) Object configObject) a promise that will resolve to a new roll-updh.TreeTableof this table. Multiple calls to this method will each produce a newdh.TreeTablewhich must haveclose()called on it when not in use.- Parameters:
configObject- specifies which columns to aggregate and which to group by, and other rollup behavior- Returns:
- Promise of
dh.TreeTable
-
treeTable
@JsMethod public elemental2.promise.Promise<JsTreeTable> treeTable(@TsTypeRef(JsTreeTableConfig.class) @TsTypeRef(JsTreeTableConfig.class) Object configObject) A promise that will resolve to a newdh.TreeTableof this table. Multiple calls to this method will each produce a newdh.TreeTablewhich must haveclose()called on it when not in use.- Parameters:
configObject- specifies which column to use as the row ID, and which for parent ID, and how to handle rows with no parent- Returns:
- Promise of
dh.TreeTable
-
freeze
A "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen table will not update. This does not change the original table, and the new table will not have any of the client side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.- Specified by:
freezein interfaceJoinableTable- Returns:
- a promise of the frozen table
-
snapshot
@JsMethod public elemental2.promise.Promise<JsTable> snapshot(JsTableReference baseTable, @JsOptional @JsNullable Boolean doInitialSnapshot, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> stampColumns) Description copied from interface:JoinableTableCreates a server-side snapshot ofbaseTablewhen this table updates.- Specified by:
snapshotin interfaceJoinableTable- Parameters:
baseTable- The table to snapshot.doInitialSnapshot- Whether to create an initial snapshot immediately.stampColumns- Optional list of stamp column match pairs to include in the result.- Returns:
- A promise that resolves to the snapshot table.
-
join
@JsMethod @Deprecated public elemental2.promise.Promise<JsTable> join(String joinType, JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsOptional @JsNullable String asOfMatchRule) Deprecated.Description copied from interface:JoinableTableJoins this table to the provided table, using one of the specified join types:AJ,ReverseAJ(orRAJ) - Inexact timeseries joins, based on the provided matching rule.CROSS_JOIN(orJoin) - Cross join of all rows that have matching values in both tables.EXACT_JOIN(orExactJoin) - Matches values in exactly one row in the right table, with errors if there is not exactly one.NATURAL_JOIN(orNatural) - Matches values in at most one row in the right table, with nulls if there is no match or errors if there are multiple matches.
Leftjoin is not supported here, unlike DHE.See the Choose a join method document for more guidance on picking a join operation.
- Specified by:
joinin interfaceJoinableTable- Parameters:
joinType- The type of join to perform, see the list above.rightTable- The table to match to values in this table.columnsToMatch- Columns that should match.columnsToAdd- Columns from the right table to add to the result - empty/null/absent to add all columns.asOfMatchRule- If joinType isAJ/RAJ/ReverseAJ, the match rule to use.- Returns:
- A promise that will resolve to the joined table.
-
asOfJoin
@JsMethod public elemental2.promise.Promise<JsTable> asOfJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsOptional @JsNullable String asOfMatchRule) Description copied from interface:JoinableTablePerforms an inexact timeseries join, where rows in this table will have columns added from the closest matching row from the right table.The
asOfMatchRulevalue can be one of:- LESS_THAN_EQUAL
- LESS_THAN
- GREATER_THAN_EQUAL
- GREATER_THAN
- Specified by:
asOfJoinin interfaceJoinableTable- Parameters:
rightTable- The table to match to values in this table.columnsToMatch- The columns that should match, according to the asOfMatchRole.columnsToAdd- Columns from the right table to add to the resulting table, empty/null/absent to add all columns.asOfMatchRule- The match rule to use, see above.- Returns:
- A promise that will resolve to the joined table.
-
crossJoin
@JsMethod public elemental2.promise.Promise<JsTable> crossJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd, @JsOptional @JsNullable Double reserveBits) Description copied from interface:JoinableTableA promise that will be resolved with the newly created table holding the results of the specified cross join operation. ThecolumnsToAddparameter is optional, not specifying it will result in all columns from the right table being added to the output. ThereserveBitsoptional parameter lets the client control how the key space is distributed between the rows in the two tables, see the JavaTableclass for details.- Specified by:
crossJoinin interfaceJoinableTable- Parameters:
rightTable- The table to match to values in this table.columnsToMatch- The columns that should match exactly.columnsToAdd- Columns from the right table to add to the resulting table, empty/null/absent to add all columns.reserveBits- The number of bits of key-space to initially reserve per group, null/absent will let the server select a value.- Returns:
- A promise that will resolve to the joined table.
-
exactJoin
@JsMethod public elemental2.promise.Promise<JsTable> exactJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd) Description copied from interface:JoinableTableA promise that will be resolved with the newly created table holding the results of the specified exact join operation. ThecolumnsToAddparameter is optional, not specifying it will result in all columns from the right table being added to the output.- Specified by:
exactJoinin interfaceJoinableTable- Parameters:
rightTable- The table to match to values in this table.columnsToMatch- The columns that should match exactly.columnsToAdd- Columns from the right table to add to the resulting table, empty/null/absent to add all columns.- Returns:
- A promise that will resolve to the joined table.
-
naturalJoin
@JsMethod public elemental2.promise.Promise<JsTable> naturalJoin(JsTableReference rightTable, elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToMatch, @JsOptional @JsNullable elemental2.core.ReadonlyArray<JsTable.MatchPairUnion> columnsToAdd) Description copied from interface:JoinableTableA promise that will be resolved with the newly created table holding the results of the specified natural join operation. ThecolumnsToAddparameter is optional, not specifying it will result in all columns from the right table being added to the output.- Specified by:
naturalJoinin interfaceJoinableTable- Parameters:
rightTable- The table to match to values in this table.columnsToMatch- The columns that should match exactly.columnsToAdd- Columns from the right table to add to the resulting table. Empty/null/absent to add all columns.- Returns:
- A promise that will resolve to the joined table.
-
byExternal
@JsMethod public elemental2.promise.Promise<JsPartitionedTable> byExternal(Object keys, @JsOptional @JsNullable Boolean dropKeys) Alias forpartitionBy(Object, Boolean).- Parameters:
keys- The partition key column name or names.dropKeys- Whether to drop the key columns from the partitioned constituent tables.- Returns:
- Promise of
JsPartitionedTable.
-
partitionBy
@JsMethod public elemental2.promise.Promise<JsPartitionedTable> partitionBy(Object keys, @JsOptional @JsNullable Boolean dropKeys) Creates a newdh.PartitionedTablefrom the contents of the current table, partitioning data based on the specified keys.- Parameters:
keys-dropKeys-- Returns:
- Promise of
dh.PartitionedTable
-
getColumnStatistics
@JsMethod public elemental2.promise.Promise<JsColumnStatistics> getColumnStatistics(Column.ColumnOrName column) Description copied from interface:JsITableComputes statistics for one column of this table, such as its count, sum and average for a numeric column, or its most common values for other types.- Specified by:
getColumnStatisticsin interfaceJsITable- Parameters:
column- the column, or the name of the column, to compute statistics for- Returns:
- a promise of the
ColumnStatisticsfor that column
-
seekRow
@JsMethod public elemental2.promise.Promise<Double> seekRow(double startingRow, Column.ColumnOrName column, @TsTypeRef(ValueType.class) @TsTypeRef(ValueType.class) String valueType, jsinterop.base.Any seekValue, @JsOptional @JsNullable Boolean insensitive, @JsOptional @JsNullable Boolean contains, @JsOptional @JsNullable Boolean isBackwards) Finds the next row, afterstartingRowand wrapping around, whose value incolumnmatchesseekValue.- Parameters:
startingRow- the position of the row to search aftercolumn- the column, or the name of the column, to searchvalueType- the type to compareseekValueasseekValue- the value to findinsensitive- optionally,trueto ignore case. Defaults tofalse.contains- optionally,trueto match values that containseekValuerather than equal it. Defaults tofalse.isBackwards- optionally,trueto search backward. Defaults tofalse.- Returns:
- a promise of the position of the matching row, or -1 if no row matches
-
maybeRevive
-
revive
-
downsample
public elemental2.promise.Promise<JsTable> downsample(LongWrapper[] zoomRange, int pixelCount, String xCol, String[] yCols) Get a downsampled version of the table. Currently only supports downsampling with an Instant or longxCol.- Parameters:
zoomRange- The visible range as[start, end]ornullto always use all data.pixelCount- The width of the visible area in pixels.xCol- The name of the X column to downsample. Must be anInstantorlong.yCols- The names of the Y columns to downsample.- Returns:
- A promise that resolves to the downsampled table.
-
isClosed
@JsProperty(name="isClosed") public boolean isClosed()trueif this table has been closed.- Returns:
- boolean
-
isRefreshing
@JsProperty(name="isRefreshing") public boolean isRefreshing()trueif this table may receive updates from the server, including size changed events, updated events after initial snapshot.- Returns:
- boolean
-
isUncoalesced
@JsProperty(name="isUncoalesced") public boolean isUncoalesced()Read-only.trueif this table is uncoalesced, indicating that work must be done before the table can be used.Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but this can be very expensive. To see which partitions are available, check each column on the table to see which have
Column.getIsPartitionColumn()astrue, and filter those columns. To read the possible values for those columns, useselectDistinct(Column[]).- Returns:
trueif the table is uncoaleced and should be filtered before operating on it, otherwisefalse.
-
getPluginName
The plugin name attribute for this table.- Returns:
- The plugin name, or
null.
-
getHandle
- Specified by:
getHandlein interfaceHasTableBinding
-
getHeadHandle
-
toString
Gets a string representation of this table instance. -
getConnection
- Specified by:
getConnectionin interfaceServerObject
-
isActive
-
setState
- Specified by:
setStatein interfaceHasTableBinding
-
getBinding
-
getCache
-
hasHandle
- Specified by:
hasHandlein interfaceHasTableBinding
-
hasRollbackHandle
-
setRollback
- Specified by:
setRollbackin interfaceHasTableBinding
-
rollback
public void rollback()- Specified by:
rollbackin interfaceHasTableBinding
-
setSize
public void setSize(double s) -
getSubscriptionId
public int getSubscriptionId() -
maybeReviveSubscription
public void maybeReviveSubscription()- Specified by:
maybeReviveSubscriptionin interfaceHasTableBinding
-
TableViewportSubscription.getViewportData()on the result fromcreateViewportSubscription(Object)instead.