Class JsPartitionedTable

All Implemented Interfaces:
ServerObject

@JsType(namespace="dh", name="PartitionedTable") public class JsPartitionedTable extends HasLifecycle implements ServerObject
Represents a set of Tables each corresponding to some key. The keys are available locally, but a call must be made to the server to get each Table. All tables will have the same structure.
  • Field Details

    • EVENT_KEYADDED

      public static final String EVENT_KEYADDED
      Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
      See Also:
    • EVENT_DISCONNECT

      public static final String EVENT_DISCONNECT
      Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
      See Also:
    • EVENT_RECONNECT

      public static final String EVENT_RECONNECT
      Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
      See Also:
    • EVENT_RECONNECTFAILED

      public static final String EVENT_RECONNECTFAILED
      Indicates that a new key has been added to the array of keys, which can now be fetched with getTable.
      See Also:
  • Constructor Details

  • Method Details

    • getConnection

      @JsIgnore public WorkerConnection getConnection()
      Specified by:
      getConnection in interface ServerObject
    • refetch

      @JsIgnore public elemental2.promise.Promise<JsPartitionedTable> refetch()
      Description copied from class: HasLifecycle
      Indicate 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:
      refetch in class HasLifecycle
      Returns:
      a promise that will resolve when this object is reconnected
    • typedTicket

      @JsIgnore public TypedTicket typedTicket()
      Specified by:
      typedTicket in interface ServerObject
    • getTable

      public elemental2.promise.Promise<@JsNullable JsTable> getTable(Object key)
      Fetch the table with the given key. If the key does not exist, returns `null`.
      Parameters:
      key - The key to fetch. An array of values for each key column, in the same order as the key columns are.
      Returns:
      Promise of dh.Table, or `null` if the key does not exist.
    • getMergedTable

      public elemental2.promise.Promise<JsTable> getMergedTable()
      Open a new table that is the result of merging all constituent tables. See PartitionedTable.merge() for details.
      Returns:
      A merged representation of the constituent tables.
    • getKeys

      public elemental2.core.JsSet<Object> getKeys()
      The set of all currently known keys. This is kept up to date, so getting the list after adding an event listener for keyadded will ensure no keys are missed.
      Returns:
      Set of Object
    • size

      @JsProperty(name="size") public int size()
      The count of known keys.
      Returns:
      int
    • getKeyColumns

      @JsProperty public Column[] getKeyColumns()
      An array of all the key columns that the tables are partitioned by.
      Returns:
      Array of Column
    • getColumns

      @JsProperty public Column[] getColumns()
      An array of the columns in the tables that can be retrieved from this partitioned table, including both key and non-key columns.
      Returns:
      Array of Column
    • getKeyTable

      @Deprecated public elemental2.promise.Promise<JsTable> getKeyTable()
      Deprecated.
      Fetch a table containing all the valid keys of the partitioned table.
      Returns:
      Promise of a Table
    • getBaseTable

      public elemental2.promise.Promise<JsTable> getBaseTable()
      Fetch the underlying base table of the partitioned table.
      Returns:
      Promise of a Table
    • close

      public void close()
      Indicates that this PartitionedTable will no longer be used, removing subcriptions to updated keys, etc. This will not affect tables in use.