Class ContinuousQueryOptions
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContinuousQueryOptionsstatic final intDefault long polling wait time in milliseconds.static final intDefault page size.static final intDefault poll interval in milliseconds. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder.Gets the column names to include in the result.booleanGets the flag that indicates whether empty batches are enabled.Gets the included event types.executor()Returns the executor that is going to be used for async delivery and execution of subscriber methods.intGets the long polling wait time in milliseconds.intpageSize()Gets the per-partition page size.Gets the partitions to subscribe to.intGets the poll interval in milliseconds.booleanGets the flag that indicates whether old entries should be skipped forTableRowEventType.UPDATEDevents.@Nullable ContinuousQueryWatermarkGets the starting watermark.
-
Field Details
-
DFLT_PAGE_SIZE
public static final int DFLT_PAGE_SIZEDefault page size.- See Also:
-
DFLT_POLL_INTERVAL_MS
public static final int DFLT_POLL_INTERVAL_MSDefault poll interval in milliseconds.- See Also:
-
DFLT_LONG_POLLING_WAIT_TIME_MS
public static final int DFLT_LONG_POLLING_WAIT_TIME_MSDefault long polling wait time in milliseconds.- See Also:
-
DEFAULT
-
-
Method Details
-
builder
Creates a new builder.- Returns:
- Builder.
-
pageSize
public int pageSize()Gets the per-partition page size.Continuous Query polls every partition in a loop. This parameter controls the number of entries that will be requested from a single partition in one network call. Therefore, the maximum number of entries that the query may hold in memory at any given time is
pageSize * partitions.Default value is
DFLT_PAGE_SIZE.- Returns:
- Page size.
-
pollIntervalMs
public int pollIntervalMs()Gets the poll interval in milliseconds. Must be non-negative. Determines the pause between partition polling cycles.Default value is
DFLT_POLL_INTERVAL_MS.- Returns:
- Poll interval in milliseconds.
-
eventTypes
Gets the included event types.By default, all event types are included.
- Returns:
- Included event types.
-
columnNames
Gets the column names to include in the result.By default, all columns are included. Excluding columns will reduce the amount of data transferred over the network.
Excluded columns are still present in the resulting entries, but are set to null.
- Returns:
- Included column names, or null to load all columns.
-
partitions
Gets the partitions to subscribe to.By default (null), all partitions are included.
- Returns:
- Included partitions, or null to include all partitions.
-
watermark
Gets the starting watermark. When null, the query will start from the current time.Watermark can be obtained with
ContinuousQueryWatermark.ofInstant(Instant), or from an event withTableRowEvent.watermark(). The latter allows resuming a query from a specific event (excluding said event, providing exactly-once semantics).Default value is null, meaning the query will start from the current time.
- Returns:
- Starting watermark.
-
enableEmptyBatches
public boolean enableEmptyBatches()Gets the flag that indicates whether empty batches are enabled.When enabled, empty batches will be sent to the subscriber when there are no new events. This is useful for watermark updates (see
TableRowEventBatch.watermark()).Default value is false, meaning empty batches are not sent to the subscriber.
- Returns:
- True if empty batches are enabled, false otherwise.
-
executor
Returns the executor that is going to be used for async delivery and execution of subscriber methods.By default common pool is used -
ForkJoinPool.commonPool().- Returns:
- Executor to use for async delivery.
-
skipOldEntries
public boolean skipOldEntries()Gets the flag that indicates whether old entries should be skipped forTableRowEventType.UPDATEDevents. Whentrue,TableRowEvent.oldEntry()will returnnullforTableRowEventType.UPDATEDevents. This reduces the amount of data transferred over the network.Default value is false, meaning old entries are not skipped.
- Returns:
- True if old entries should be skipped, false otherwise.
-
longPollingWaitTimeMs
public int longPollingWaitTimeMs()Gets the long polling wait time in milliseconds.Default value is
DFLT_LONG_POLLING_WAIT_TIME_MS. A zero or negative value disables long polling.Long polling is an optimization that reduces latency and network round trips. When the client polls a partition and no events are immediately available, instead of returning an empty response, the server holds the request open for up to
longPollingWaitTimeMsmilliseconds, waiting for new events to arrive. If events arrive during this wait period, they are returned immediately. If the timeout expires with no events, an empty response is returned.Works together with
pollIntervalMs(). After receiving a response (with or without data), the client waitspollIntervalMs. For minimal latency, reducepollIntervalMsand increaselongPollingWaitTimeMs. For better throughput and batching, increasepollIntervalMsandpageSize.- Returns:
- Long polling wait time in milliseconds. A zero or negative value means no long polling.
-