Class FixedDestinationResolver

java.lang.Object
io.github.flink.gcp.connector.bigtable.sink.FixedDestinationResolver
All Implemented Interfaces:
DestinationResolver<Object>, Serializable

@Internal public final class FixedDestinationResolver extends Object implements DestinationResolver<Object>
A DestinationResolver returning one fixed destination for every record, which is what BigtableSinkBuilder.table(...) builds.

A named class instead of a synthesized lambda because lambda serialization would tie the job graph to fragile SerializedLambda synthetic-method identity across connector versions.

The writer does not branch on this type: it resolves and looks its destination state up per record whichever resolver is configured. A fixed resolve returns the same instance, so the lookup's equals settles on identity, and what a record actually costs is measured in ADR-0041 — the per-record toProto() dominates both. One path is one path that gets tested.

See Also:
  • Constructor Details

    • FixedDestinationResolver

      public FixedDestinationResolver(TableDestination destination)
      Creates a resolver returning the given destination for every record.
      Parameters:
      destination - the destination table
  • Method Details

    • getDestination

      public TableDestination getDestination()
      Returns the fixed destination.
    • resolve

      public TableDestination resolve(Object element, org.apache.flink.api.connector.sink2.SinkWriter.Context context)
      Description copied from interface: DestinationResolver
      Returns the destination table for the given record.
      Specified by:
      resolve in interface DestinationResolver<Object>
      Parameters:
      element - the record
      context - writer context exposing the record's event timestamp and current watermark, or null when invoked by the conditional async helper
      Returns:
      the destination table; never null