Class ContinuousQueryOptions
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a new builder.Gets the column names to include in the result.boolean
Gets 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.int
pageSize()
Gets the per-partition page size.Gets the partitions to subscribe to.int
Gets the poll interval in milliseconds.boolean
Gets the flag that indicates whether old entries should be skipped forTableRowEventType.UPDATED
events.@Nullable ContinuousQueryWatermark
Gets the starting watermark.
-
Field Details
-
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 1000.
- Returns:
- Page size.
-
pollIntervalMs
public int pollIntervalMs()Gets the poll interval in milliseconds.Default value is 1000 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.UPDATED
events. Whentrue
,TableRowEvent.oldEntry()
will returnnull
forTableRowEventType.UPDATED
events. 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.
-