Class AbstractTableSubscription
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.subscription.AbstractTableSubscription
- Direct Known Subclasses:
JsTreeTable.TreeSubscription
,TableSubscription
,TableViewportSubscription
Superclass of various subscription types, allowing specific implementations to customize behavior for their needs.
Instances are not ready to use right away, owing to the fact that we need to wait both for the provided state to resolve (so that we have the table schema, know what kind of subscription we will make, and know what column types will be resolves), and because until the subscription has finished being set up, we will not have received the size of the table. When closed, it cannot be reused again.
This is also a base class for types exposed to JS.
This is a rough analog of the JVM's BarrageSubscriptionImpl
class. In contrast to the JVM code, this is
exposed to api consumers, rather than wrapping in a Table type, as it handles the barrage stream and provides events
that client code can listen to.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
static class
TableData type for full table subscriptions.static class
static class
Base type to allow trees to extend from here separately from tables.static class
TableData type for viewport subscriptions.Nested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WebBarrageSubscription
static final String
Indicates that some new data is available on the client, either an initial snapshot or a delta update.protected int
protected AbstractTableSubscription.Status
protected RangeSet
Fields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTableSubscription
(SubscriptionType subscriptionType, ClientTableState state, WorkerConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Stops the subscription on the server.protected WorkerConnection
elemental2.core.JsArray<Column>
The columns that were subscribed to when this subscription was createdboolean
Returns true if the subscription is in a state where it can be used to read data, false if still waiting for the server to send the first snapshot or if the subscription has been closed.boolean
isClosed()
Returns true if the subscription is closed and cannot be used again, false if it is actively listening for more data.protected boolean
True if the subscription is in the ACTIVE state, meaning that the server and client are in sync with the state of the subscription.protected BitSet
makeColumnBitset
(elemental2.core.JsArray<Column> columns) protected void
notifyUpdate
(RangeSet rowsAdded, RangeSet rowsRemoved, RangeSet totalMods, ShiftedRange[] shifted) protected void
protected void
revive()
Creates the connection to the server.protected void
sendBarrageSubscriptionRequest
(@Nullable RangeSet viewport, elemental2.core.JsArray<Column> columns, Double updateIntervalMs, boolean isReverseViewport) protected abstract void
double
size()
state()
protected static com.google.flatbuffers.FlatBufferBuilder
subscriptionRequest
(byte[] tableTicket, BitSet columns, @Nullable RangeSet viewport, BarrageSubscriptionOptions options, boolean isReverseViewport) Methods 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, unsuppressEvents
-
Field Details
-
EVENT_UPDATED
Indicates that some new data is available on the client, either an initial snapshot or a delta update. The detail field of the event will contain a TableSubscriptionEventData detailing what has changed, or allowing access to the entire range of items currently in the subscribed columns.- See Also:
-
rowStyleColumn
protected int rowStyleColumn -
viewportRowSet
-
barrageSubscription
-
status
-
-
Constructor Details
-
AbstractTableSubscription
protected AbstractTableSubscription(SubscriptionType subscriptionType, ClientTableState state, WorkerConnection connection)
-
-
Method Details
-
revive
protected void revive()Creates the connection to the server. Used on initial connection, and for viewport reconnects. -
sendFirstSubscriptionRequest
protected abstract void sendFirstSubscriptionRequest() -
makeColumnBitset
-
state
-
connection
-
isSubscriptionReady
protected boolean isSubscriptionReady()True if the subscription is in the ACTIVE state, meaning that the server and client are in sync with the state of the subscription. -
isClosed
public boolean isClosed()Returns true if the subscription is closed and cannot be used again, false if it is actively listening for more data. -
hasValidSize
public boolean hasValidSize()Returns true if the subscription is in a state where it can be used to read data, false if still waiting for the server to send the first snapshot or if the subscription has been closed.- Returns:
- true if the
size()
method will return data based on the subscription, false if some other source of the table's size will be used.
-
size
public double size() -
onStreamEnd
-
getColumns
The columns that were subscribed to when this subscription was created- Returns:
Column
-
close
@JsMethod public void close()Stops the subscription on the server.
-