Class TopicDestination
java.lang.Object
io.github.flink.gcp.connector.pubsub.sink.TopicDestination
- All Implemented Interfaces:
Serializable
A fully-qualified Pub/Sub topic reference: project and topic.
Instances are pure topic identity: equals(Object) and hashCode()
are defined over exactly (project, topic) so the class can serve as a per-destination key (the
writer's per-topic publisher map). Publisher settings are intentionally not part of this class —
they are configured on the sink — keeping destination identity stable.
Instances are immutable; the resource path and hash are precomputed, so they are cheap to use as map keys on the per-record write path. Resolvers should still cache and reuse instances instead of re-creating them per record.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the Google Cloud project id, given as a bare id rather than a resource path.getTopic()Returns the Pub/Sub topic id, given as a bare id rather than a resource path.inthashCode()static TopicDestinationCreates aTopicDestinationfrom bare ids, not resource paths.toString()Returns the topic path in theprojects/<p>/topics/<t>form used by the Pub/Sub API.
-
Method Details
-
of
Creates aTopicDestinationfrom bare ids, not resource paths.- Parameters:
project- the Google Cloud project idtopic- the Pub/Sub topic id- Returns:
- the destination
- Throws:
IllegalArgumentException- if a component is null or blank, has leading or trailing whitespace, or contains'/'— a separator would make the composed resource path address a different resource
-
getProject
Returns the Google Cloud project id, given as a bare id rather than a resource path. -
getTopic
Returns the Pub/Sub topic id, given as a bare id rather than a resource path. -
toTopicPath
Returns the topic path in theprojects/<p>/topics/<t>form used by the Pub/Sub API. -
equals
-
hashCode
public int hashCode() -
toString
-