Class SpannerClientMetricsConfig

java.lang.Object
io.github.flink.gcp.connector.spanner.table.SpannerClientMetricsConfig
All Implemented Interfaces:
Serializable

@Internal public final class SpannerClientMetricsConfig extends Object implements Serializable
The two client-metrics options of a Spanner table, as a table declared them.

One value rather than two fields on every table source and sink, because all of them carry both to every component that builds a client: the sink writer, the scan's enumerator and readers through the DataStream builders, and the lookup functions directly. A key the table leaves out stays unset, so a builder keeps its own default.

See Also:
  • Method Details

    • unset

      public static SpannerClientMetricsConfig unset()
      Returns the options of a table that declares neither, so every builder keeps its default.
    • from

      public static SpannerClientMetricsConfig from(org.apache.flink.configuration.ReadableConfig config)
      Reads both options from a table's configuration.
      Parameters:
      config - the table's options
      Returns:
      the options as declared
    • applyTo

      public void applyTo(Consumer<Boolean> toFlink, Consumer<Boolean> toCloudMonitoring)
      Hands each declared option to a builder's setter, under its key if the setter refuses it.
      Parameters:
      toFlink - the builder's exportClientMetricsToFlink
      toCloudMonitoring - the builder's exportClientMetricsToCloudMonitoring
    • exportToFlink

      public boolean exportToFlink()
      Returns whether the client metrics are exported to Flink, the default when unset.
    • exportToCloudMonitoring

      public boolean exportToCloudMonitoring()
      Returns whether the client takes part in the Cloud Monitoring export, the default when unset.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object