Class ChalkSinkConfig.Builder

java.lang.Object
ai.chalk.flink.core.ChalkSinkConfig.Builder
Enclosing class:
ChalkSinkConfig

public static final class ChalkSinkConfig.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • clientId

      public ChalkSinkConfig.Builder clientId(String v)
      Chalk client id (required).
    • clientSecret

      public ChalkSinkConfig.Builder clientSecret(String v)
      Chalk client secret (required).
    • apiServer

      public ChalkSinkConfig.Builder apiServer(String v)
      API server for token exchange. Defaults to https://api.chalk.ai.
    • environmentId

      public ChalkSinkConfig.Builder environmentId(String v)
      Target environment id. Defaults to the token's primary environment.
    • queryServer

      public ChalkSinkConfig.Builder queryServer(String v)
      Override the gRPC query/engine server. Defaults to the engine resolved from the token.
    • branch

      public ChalkSinkConfig.Builder branch(String v)
      Target a branch deployment instead of production.
    • batchSize

      public ChalkSinkConfig.Builder batchSize(int v)
      Flush when this many rows are buffered. Default 1000.
    • flushInterval

      public ChalkSinkConfig.Builder flushInterval(Duration v)
      Flush a non-empty buffer at least this often, in millis. Default 5000.
    • uploadTimeout

      public ChalkSinkConfig.Builder uploadTimeout(Duration v)
      Per-call upload deadline. Default 30s.
    • maxRetries

      public ChalkSinkConfig.Builder maxRetries(int v)
      Optional hard cap on retries per batch, in addition to the first attempt. Unlimited by default — retryTimeout(java.time.Duration) is the primary bound. Set this only to stop retrying after a fixed number of attempts regardless of how much time budget remains.
    • retryBackoff

      public ChalkSinkConfig.Builder retryBackoff(Duration v)
      Base backoff between retries, in millis (doubled each attempt, capped at 30s). Default 500.
    • retryTimeout

      public ChalkSinkConfig.Builder retryTimeout(Duration v)
      Total wall-clock budget for retrying one batch's transient failures. Default 120s, chosen to outlast a routine query-server rollout: a shorter budget surfaces the outage as a Flink task failure and a restart from the last checkpoint.

      Retries block the task thread, so this is also the worst-case stall for the subtask. Keep it below the checkpoint timeout.

    • failOnUploadErrors

      public ChalkSinkConfig.Builder failOnUploadErrors(boolean v)
      When true (default), a batch whose response carries engine data-level errors fails the sink.

      Poison-pill warning: data-level errors (e.g. a bad feature type) are deterministic — unlike transient transport errors, replaying the same batch after a checkpoint restart reproduces the same error, wedging the pipeline in a restart loop with no forward progress. If your stream may contain individually-invalid rows, either fix them upstream or set this false to log a WARN and drop the rejected rows (at-least-once for the rest; the bad rows are lost).

    • writeOnline

      public ChalkSinkConfig.Builder writeOnline(boolean v)
      Write to the online store. Default true.
    • writeOffline

      public ChalkSinkConfig.Builder writeOffline(boolean v)
      Also write to the offline store. Default false. Requires a chalk-java version whose UploadFeaturesParams exposes write targets (see README "Write targets").
    • updateMataggs

      public ChalkSinkConfig.Builder updateMataggs(boolean v)
      Update materialized (streaming) aggregations on upload. Default false. Requires a chalk-java version whose UploadFeaturesParams exposes write targets.
    • build

      public ChalkSinkConfig build()