Interface SubscriptionOptions


@Immutable public interface SubscriptionOptions
Implementations of this interface provide parameters for a ConnectionAwareRemoteTable to maintain a subscription to a remote table.
  • Method Details

    • getMaxInboundMessageSize

      static int getMaxInboundMessageSize()
      Get the maximum inbound message size.
      Returns:
      the maximum inbound message size
    • clearOnDisconnect

      @Default default boolean clearOnDisconnect()
      If the result table should clear its rows when a disconnect occurs. Defaults to true.
      Returns:
      if the result table should clear rows on disconnection/
    • retryWindowMillis

      @Default default long retryWindowMillis()
      The width of the window in milliseconds in which to attempt to reconnect. Defaults to 60 seconds, unless changed via the ConnectionAwareRemoteTableParams.retryWindowMillis property.
      Returns:
      the reconnection window in milliseconds
    • maxRetriesWithinWindow

      @Default default long maxRetriesWithinWindow()
      The maximum number of retries to attempt within the window. Defaults to 5, unless changed via tha ConnectionAwareRemoteTableParams.maxRetries property.
      Returns:
      the maximum allowed retries in the window
    • includedColumns

      @NotNull @NotNull Set<String> includedColumns()
      Get the columns to include from the upstream table. Defaults to all (null)
      Returns:
      the columns to include, or null for all of them.
    • filters

      @NotNull @NotNull List<String> filters()
      Get the list of filters to be applied in conjunction with filter() before subscribing to the table.
      Returns:
      the list of filters to apply
    • filter

      @Nullable @Default default @Nullable Filter filter()
      Get the Filter to be applied in conjunction with filters() before subscribing to the table.
      Returns:
      the list of filters to apply
    • waitForData

      @Default default boolean waitForData()
      Whether to block the caller in RemoteTableBuilder.subscribe() until the complete initial table snapshot has been received. Defaults to true.

      When false, the caller must provide a TableDefinition via RemoteTableBuilder.tableDefinition(TableDefinition) because the schema cannot be discovered without waiting for the upstream query. An IllegalArgumentException is thrown immediately if no definition is set.

      Returns:
      whether to wait for the initial snapshot before returning
    • waitTimeout

      @NotNull @NotNull Optional<Duration> waitTimeout()
      Timeout to wait for the initial snapshot when waitForData() is true. An empty Optional means wait indefinitely. Defaults to Optional.empty().
      Returns:
      the wait timeout, or Optional.empty() for no timeout
    • builder

      @NotNull static @NotNull SubscriptionOptions.Builder builder()
      Returns:
      a new builder.
    • check

      @Check @FinalDefault default void check()
      Ensure the state is valid.