Class TablePublisher
blink table
from added tables
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a snapshot of the data fromtable
into theblink table
.Theblink table's
definition.Creates a newblink table
with itsattribute
"InputTable" set to anInputTableUpdater
implementation based onthis
.boolean
isAlive()
Checks whetherthis
is alive; iffalse
, the caller should stop adding new data and release any related resources as soon as practicable since adding data won't have any downstream effects.static TablePublisher
of
(String name, TableDefinition definition, Consumer<TablePublisher> onFlushCallback, Runnable onShutdownCallback) Constructs a table publisher.static TablePublisher
of
(String name, TableDefinition definition, Consumer<TablePublisher> onFlushCallback, Runnable onShutdownCallback, UpdateGraph updateGraph, int chunkSize) Constructs a table publisher.void
publishFailure
(Throwable failure) Indicate that data publication has failed.table()
Theblink table
.
-
Method Details
-
of
public static TablePublisher of(String name, TableDefinition definition, @Nullable Consumer<TablePublisher> onFlushCallback, @Nullable Runnable onShutdownCallback) Constructs a table publisher.The
onFlushCallback
, if present, is called once at the beginning of each update graph cycle. This is a pattern that allows publishers to add any data they may have been batching. Do note though, this blocks the update cycle from proceeding, so implementations should take care to not do extraneous work.The
onShutdownCallback
, if present, is called one time when the publisher should stop publishing new data and release any related resources as soon as practicable since publishing won't have any downstream effects.Equivalent to calling
of(String, TableDefinition, Consumer, Runnable, UpdateGraph, int)
with theupdateGraph
fromExecutionContext.getContext()
andchunkSize
2048.- Parameters:
name
- the namedefinition
- the table definitiononFlushCallback
- the on-flush callbackonShutdownCallback
- the on-shutdown callback- Returns:
- the table publisher
-
of
public static TablePublisher of(String name, TableDefinition definition, @Nullable Consumer<TablePublisher> onFlushCallback, @Nullable Runnable onShutdownCallback, UpdateGraph updateGraph, int chunkSize) Constructs a table publisher.The
onFlushCallback
, if present, is called once at the beginning of each update graph cycle. This is a pattern that allows publishers to add any data they may have been batching. Do note though, this blocks the update cycle from proceeding, so implementations should take care to not do extraneous work.The
onShutdownCallback
, if present, is called one time when the publisher should stop publishing new data and release any related resources as soon as practicable since publishing won't have any downstream effects.The
chunkSize
is the size at which chunks will be filled from the source table during anadd(io.deephaven.engine.table.Table)
. The suggested value is 2048.- Parameters:
name
- the namedefinition
- the table definitiononFlushCallback
- the on-flush callbackonShutdownCallback
- the on-shutdown callbackupdateGraph
- the update graph for the blink tablechunkSize
- the chunk size is the maximum size- Returns:
- the table publisher
-
definition
Theblink table's
definition.- Returns:
- the definition
-
table
Theblink table
.May return
null
if invoked more than once and the initial caller does not enforce strong reachability of the result.- Returns:
- the blink table
-
add
Adds a snapshot of the data fromtable
into theblink table
. The addedtable
must contain a superset of the columns from thedefinition
; the columns may be in any order. Columns fromtable
that are not in thedefinition
are ignored.All of the data from
table
will be:- consistent with a point in time
- fully contained in a single blink table's update cycle
- non-interleaved with any other calls to add (concurrent, or not)
- Parameters:
table
- the table to add
-
publishFailure
Indicate that data publication has failed.Blink table
listeners
will be notified of the failure, the on-shutdown callback will be invoked if it hasn't already been,this
publisher will no longer bealive
, and future calls toadd
will silently return without publishing. These effects may resolve asynchronously.- Parameters:
failure
- the failure
-
isAlive
public boolean isAlive()Checks whetherthis
is alive; iffalse
, the caller should stop adding new data and release any related resources as soon as practicable since adding data won't have any downstream effects.Once this is
false
, it will always remainfalse
. For more prompt notifications, callers may prefer to use on-shutdown callbacks.- Returns:
- if this is alive
-
inputTable
Creates a newblink table
with itsattribute
"InputTable" set to anInputTableUpdater
implementation based onthis
. The implementation's definition of "completed" with respect toInputTableUpdater.add(Table)
andInputTableUpdater.addAsync(Table, InputTableStatusListener)
matches the semantics provided byadd(Table)
- that is, "completed" means that a snapshot ofnewData
has been taken and handed off. The implementation does not implementInputTableUpdater.delete(Table)
norInputTableUpdater.deleteAsync(Table, InputTableStatusListener)
.May return
null
if invoked more than once and the initial caller does not enforce strong reachability of the result.- Returns:
- the input-table blink table
-