TablePublisher
The TablePublisher class creates a blink table from tables that are added to it via the add method.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| name | String | The name of the table publisher. |
| definition | TableDefinition | The table definition. |
| onFlushCallback | Consumer | The on-flush callback. If not |
| onShutdownCallback | Runnable | The on-shutdown callback. If not |
| updateGraph | UpdateGraph | The update graph for the blink table. |
| chunkSize | int | The maximum chunk size. The default value is 2048. |
Returns
A new TablePublisher.
Methods
TablePublisher supports the following methods:
add(table)- Adds a table to the blink table.definition()- Gets the table definition.isAlive()- Checks if the table publisher is alive.publishFailure(failure)- Indicate that data publication has hailed. Listeners will be notified, the on-shutdown callback will be invoked (if it hasn't already been), and future calls toaddwill return without doing anything.table()- Gets the blink table.
Examples
In this example, TablePublisher is used to create a blink table with three columns (X, Y, and Z). The columns are of type int, double, and double, respectively.
To add data to blink table, call add.
To shut the publisher down, call publishFailure.