Class FixedDestinationResolver

java.lang.Object
io.github.flink.gcp.connector.cloudtasks.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.

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.

See Also:
  • Constructor Details

    • FixedDestinationResolver

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

    • getDestination

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

      public QueueDestination resolve(Object element, org.apache.flink.api.connector.sink2.SinkWriter.Context context)
      Description copied from interface: DestinationResolver
      Returns the destination queue 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
      Returns:
      the destination queue; never null