Class FunctionGeneratedTableSpec
java.lang.Object
io.deephaven.engine.table.impl.util.FunctionGeneratedTableSpec
Describes how a
FunctionGeneratedTableFactory should build and refresh a function-generated table.
Exactly one of tableSupplier() or retainingLastTableSupplier() must be provided. The former always
produces a new table on each invocation; the latter may return an empty Optional, in which case the
previously produced result is retained for the next cycle rather than being regenerated.
At most one of refreshInterval() or dependencies() may be provided. A refreshInterval()
drives periodic (wall-clock) refreshes; dependencies() drives refreshes when at least one of the listed
tables ticks. If neither is provided, the supplier is invoked exactly once at construction and the result is static.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhentrue, the result is presented as ablink table: each refresh removes the previous rows and adds the newly generated rows, and downstream operations treat the result as retaining only the current cycle's rows.builder()booleancopyData()Whentrue(the default), the generated data is copied into the result table using a flat, contiguousRowSet, exactly as the legacyFunctionGeneratedTableFactorydoes.The tables that, when any of them ticks, cause the supplier to be invoked in a dependency-respecting way.The wall-clock interval at which to invoke the supplier.A supplier that may not produce a new table; when it returns an emptyOptional, the previous result is retained for the next cycle.abstract Optional<TableDefinition> The table definition to use for the result.A supplier that always produces a new table to be reflected in the result.
-
Constructor Details
-
FunctionGeneratedTableSpec
public FunctionGeneratedTableSpec()
-
-
Method Details
-
builder
-
tableSupplier
A supplier that always produces a new table to be reflected in the result. Mutually exclusive withretainingLastTableSupplier().- Returns:
- the table supplier
-
retainingLastTableSupplier
A supplier that may not produce a new table; when it returns an emptyOptional, the previous result is retained for the next cycle. Mutually exclusive withtableSupplier().- Returns:
- the retaining-last table supplier
-
refreshInterval
The wall-clock interval at which to invoke the supplier. Mutually exclusive withdependencies().- Returns:
- the refresh interval
-
dependencies
The tables that, when any of them ticks, cause the supplier to be invoked in a dependency-respecting way. Mutually exclusive withrefreshInterval().- Returns:
- the dependency tables
-
copyData
@Default public boolean copyData()Whentrue(the default), the generated data is copied into the result table using a flat, contiguousRowSet, exactly as the legacyFunctionGeneratedTableFactorydoes. Whenfalse, the result delegates directly to the generated table's column sources viaSwitchColumnSource, avoiding the copy and adopting the generated table's ownRowSetshape. In either case, each refresh that produces a table is a full replacement (all previous rows removed, all new rows added). Because the generated column sources are retained across cycles when not copying, a refreshing generated table must expose immutable column sources.- Returns:
- whether to copy the generated data into the result
-
blinkTable
@Default public boolean blinkTable()Whentrue, the result is presented as ablink table: each refresh removes the previous rows and adds the newly generated rows, and downstream operations treat the result as retaining only the current cycle's rows. Rows generated in one update cycle are removed on the next cycle whether or not the generator runs again. Defaults tofalse. Requires a refresh trigger (arefreshInterval()ordependencies()).- Returns:
- whether to present the result as a blink table
-
tableDefinition
The table definition to use for the result. When provided, it is authoritative: it defines the result's columns, and every table the supplier produces (including the initial one) must bemutually compatiblewith it, or construction (or a subsequent refresh) fails. When not provided, the supplier's table defines the result's columns, so a definition is required only when aretainingLastTableSupplier()produces no table at construction time; if no definition is provided and the initial supplier invocation yields no table, construction fails.- Returns:
- the optional table definition
-