Class OptionSetters

java.lang.Object
io.github.flink.gcp.connector.bigtable.table.OptionSetters

@Internal public final class OptionSetters extends Object
Applies Table API option values to DataStream builder setters, renaming a rejected value's failure to the option key the SQL caller actually wrote (issue #1030, ADR-0133).

A builder setter's Preconditions message names the setter — the right name for a DataStream caller, and one that appears nowhere in a WITH clause. FactoryUtil wraps whatever a factory throws in a ValidationException whose own message says only "Unable to create a …" line for the table, leaving the actionable sentence in the cause, so the rename here is what makes the failure name the option. The builder's sentence stays as the detail: the bound itself is defined and tested there, never restated here.

  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> void
    accept(String optionKey, T value, Consumer<T> setter)
    Applies an already-extracted value to the setter under the given option key, for a site whose value no longer sits in a ReadableConfig.
    static <T> void
    apply(org.apache.flink.configuration.ReadableConfig config, org.apache.flink.configuration.ConfigOption<T> option, Consumer<T> setter)
    Applies the option's value to the setter when present; a value the setter rejects fails as a ValidationException naming the option key, with the setter's own message as detail.
    static <T, R> R
    convert(String optionKey, T value, Function<T,R> converter)
    Converts an already-extracted value under the given option key, for a site whose target is a factory method rather than a builder setter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • apply

      public static <T> void apply(org.apache.flink.configuration.ReadableConfig config, org.apache.flink.configuration.ConfigOption<T> option, Consumer<T> setter)
      Applies the option's value to the setter when present; a value the setter rejects fails as a ValidationException naming the option key, with the setter's own message as detail.
    • accept

      public static <T> void accept(String optionKey, @Nullable T value, Consumer<T> setter)
      Applies an already-extracted value to the setter under the given option key, for a site whose value no longer sits in a ReadableConfig. A null value applies nothing, mirroring an absent option.
    • convert

      public static <T, R> R convert(String optionKey, T value, Function<T,R> converter)
      Converts an already-extracted value under the given option key, for a site whose target is a factory method rather than a builder setter.