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 Summary
ConstructorsConstructorDescriptionFixedDestinationResolver(TableDestination destination) Creates a resolver returning the given destination for every record. -
Method Summary
Modifier and TypeMethodDescriptionReturns the fixed destination.Returns the destination table for the given record.
-
Constructor Details
-
FixedDestinationResolver
Creates a resolver returning the given destination for every record.- Parameters:
destination- the destination table
-
-
Method Details
-
getDestination
Returns the fixed destination. -
resolve
public TableDestination resolve(Object element, org.apache.flink.api.connector.sink2.SinkWriter.Context context) Description copied from interface:DestinationResolverReturns the destination table for the given record.- Specified by:
resolvein interfaceDestinationResolver<Object>- Parameters:
element- the recordcontext- writer context exposing the record's event timestamp and current watermark, ornullwhen invoked by the conditional async helper- Returns:
- the destination table; never
null
-