Package com.linkedin.venice.pubsub
Class PubSubConsumerAdapterFactory<ADAPTER extends PubSubConsumerAdapter>
java.lang.Object
com.linkedin.venice.pubsub.PubSubConsumerAdapterFactory<ADAPTER>
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ApacheKafkaConsumerAdapterFactory
public abstract class PubSubConsumerAdapterFactory<ADAPTER extends PubSubConsumerAdapter>
extends Object
implements Closeable
Generic factory interface for creating PubSub consumers.
Concrete implementations should create and configure consumers for a specific PubSub system (e.g., Kafka, Pulsar).
Implementations must provide a public no-arg constructor to support reflective instantiation.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for PubSubConsumerAdapterFactory used mainly for reflective instantiation. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureMonitoringForStore(String storeName, Predicate<PubSubTopicPartition> positionFilter) Installs a CDC monitoring-only position gate before creating ingestion consumers.abstract ADAPTERcreate(PubSubConsumerAdapterContext context) Creates a PubSub consumer adapter.abstract StringgetName()booleanisAutomaticMonitoringEnabled(VeniceProperties consumerProperties) Whether these consumer properties enable adapter-owned automatic monitoring publication.
-
Constructor Details
-
PubSubConsumerAdapterFactory
public PubSubConsumerAdapterFactory()Constructor for PubSubConsumerAdapterFactory used mainly for reflective instantiation.
-
-
Method Details
-
create
Creates a PubSub consumer adapter.- Parameters:
context- The context containing all dependencies and configurations required to create a consumer.- Returns:
- An instance of the PubSub consumer adapter.
-
isAutomaticMonitoringEnabled
Whether these consumer properties enable adapter-owned automatic monitoring publication. Factories must report their existing monitoring opt-in, or explicitly return false if they have no automatic monitoring publisher. This is not a new consumer configuration. The default rejects an undeclared capability rather than silently treating it as disabled. This hook is queried during CDC monitoring setup; consumers without a monitoring gate are unchanged. -
configureMonitoringForStore
public void configureMonitoringForStore(String storeName, Predicate<PubSubTopicPartition> positionFilter) Installs a CDC monitoring-only position gate before creating ingestion consumers. This must not filter ingestion or recovery checkpoints. Implementations must disable every native automatic monitoring publication path and replace it with selected explicit positions. A factory that cannot do so must fail rather than silently publish prefetched positions. Pooled consumers apply every store's gate; a later call for the same store replaces its gate. Each predicate must preserve unrelated non-view positions; CDC clients choose supported topics and validate exact version-topic ownership. -
getName
-