Class AbstractPulsarConsumerProcessor<T>
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.pulsar.AbstractPulsarConsumerProcessor<T>
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
- Direct Known Subclasses:
ConsumePulsar,ConsumePulsarRecord
public abstract class AbstractPulsarConsumerProcessor<T>
extends org.apache.nifi.processor.AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorprivate ExecutorServiceprivate ExecutorCompletionService<Object>static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate ExecutorServiceprivate PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> private ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>>(package private) static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.AllowableValueprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorprotected static final List<org.apache.nifi.components.PropertyDescriptor>static final org.apache.nifi.components.PropertyDescriptorprotected static final Stringprivate PulsarClientServicestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.processor.Relationshipprotected static final Set<org.apache.nifi.processor.Relationship>static final org.apache.nifi.components.PropertyDescriptorprotected static final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp(org.apache.nifi.processor.ProcessContext context) protected voidconsumeAsync(org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord> consumer, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) protected Collection<org.apache.nifi.components.ValidationResult>customValidate(org.apache.nifi.components.ValidationContext validationContext) protected ExecutorServiceprotected ExecutorCompletionService<Object>protected org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>getConsumer(org.apache.nifi.processor.ProcessContext context, String topic) protected org.apache.pulsar.client.api.ConsumerBuilder<org.apache.pulsar.client.api.schema.GenericRecord>getConsumerBuilder(org.apache.nifi.processor.ProcessContext context) protected StringgetConsumerId(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) Method returns a string that uniquely identifies a consumer by concatenating the topic name and subscription properties together.protected ExecutorServiceprotected PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> protected ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>>getMappedFlowFileAttributes(org.apache.nifi.processor.ProcessContext context, org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord> msg) protected PulsarClientServiceSet<org.apache.nifi.processor.Relationship>protected List<org.apache.nifi.components.PropertyDescriptor>voidinit(org.apache.nifi.processor.ProcessContext context) protected booleanisSharedSubscription(org.apache.nifi.processor.ProcessContext context) protected voidsetAckPool(ExecutorService pool) protected voidsetAckService(ExecutorCompletionService<Object> ackService) protected voidprotected voidsetConsumers(PulsarConsumerLRUCache<String, org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> consumers) protected voidsetConsumerService(ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>> service) protected voidsetPulsarClientService(PulsarClientService pulsarClientService) voidshutDown(org.apache.nifi.processor.ProcessContext context) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTrigger, onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful
-
Field Details
-
PULSAR_MESSAGE_KEY
- See Also:
-
EXCLUSIVE
protected static final org.apache.nifi.components.AllowableValue EXCLUSIVE -
KEY_SHARED
protected static final org.apache.nifi.components.AllowableValue KEY_SHARED -
SHARED
protected static final org.apache.nifi.components.AllowableValue SHARED -
FAILOVER
protected static final org.apache.nifi.components.AllowableValue FAILOVER -
CONSUME
static final org.apache.nifi.components.AllowableValue CONSUME -
DISCARD
static final org.apache.nifi.components.AllowableValue DISCARD -
FAIL
static final org.apache.nifi.components.AllowableValue FAIL -
OFFSET_EARLIEST
static final org.apache.nifi.components.AllowableValue OFFSET_EARLIEST -
OFFSET_LATEST
static final org.apache.nifi.components.AllowableValue OFFSET_LATEST -
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
PULSAR_CLIENT_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor PULSAR_CLIENT_SERVICE -
TOPICS
public static final org.apache.nifi.components.PropertyDescriptor TOPICS -
TOPICS_PATTERN
public static final org.apache.nifi.components.PropertyDescriptor TOPICS_PATTERN -
SUBSCRIPTION_NAME
public static final org.apache.nifi.components.PropertyDescriptor SUBSCRIPTION_NAME -
SUBSCRIPTION_INITIAL_POSITION
public static final org.apache.nifi.components.PropertyDescriptor SUBSCRIPTION_INITIAL_POSITION -
ASYNC_ENABLED
public static final org.apache.nifi.components.PropertyDescriptor ASYNC_ENABLED -
AUTO_UPDATE_PARTITIONS
public static final org.apache.nifi.components.PropertyDescriptor AUTO_UPDATE_PARTITIONS -
AUTO_UPDATE_PARTITION_INTERVAL
public static final org.apache.nifi.components.PropertyDescriptor AUTO_UPDATE_PARTITION_INTERVAL -
MAX_ASYNC_REQUESTS
public static final org.apache.nifi.components.PropertyDescriptor MAX_ASYNC_REQUESTS -
ACK_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor ACK_TIMEOUT -
EXPIRE_TIME_OF_INCOMPLETE_CHUNKED_MESSAGE
public static final org.apache.nifi.components.PropertyDescriptor EXPIRE_TIME_OF_INCOMPLETE_CHUNKED_MESSAGE -
AUTO_ACK_OLDEST_CHUNKED_ON_QUEUE_FULL
public static final org.apache.nifi.components.PropertyDescriptor AUTO_ACK_OLDEST_CHUNKED_ON_QUEUE_FULL -
MAX_PENDING_CHUNKED_MESSAGE
public static final org.apache.nifi.components.PropertyDescriptor MAX_PENDING_CHUNKED_MESSAGE -
CONSUMER_NAME
public static final org.apache.nifi.components.PropertyDescriptor CONSUMER_NAME -
PRIORITY_LEVEL
public static final org.apache.nifi.components.PropertyDescriptor PRIORITY_LEVEL -
RECEIVER_QUEUE_SIZE
public static final org.apache.nifi.components.PropertyDescriptor RECEIVER_QUEUE_SIZE -
SUBSCRIPTION_TYPE
public static final org.apache.nifi.components.PropertyDescriptor SUBSCRIPTION_TYPE -
MESSAGE_DEMARCATOR
public static final org.apache.nifi.components.PropertyDescriptor MESSAGE_DEMARCATOR -
CONSUMER_BATCH_SIZE
public static final org.apache.nifi.components.PropertyDescriptor CONSUMER_BATCH_SIZE -
MAPPED_FLOWFILE_ATTRIBUTES
public static final org.apache.nifi.components.PropertyDescriptor MAPPED_FLOWFILE_ATTRIBUTES -
REPLICATE_SUBSCRIPTION_STATE
public static final org.apache.nifi.components.PropertyDescriptor REPLICATE_SUBSCRIPTION_STATE -
PROPERTIES
-
RELATIONSHIPS
-
pulsarClientService
-
consumers
private PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> consumers -
consumerPool
-
consumerService
private ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>> consumerService -
ackPool
-
ackService
-
-
Constructor Details
-
AbstractPulsarConsumerProcessor
public AbstractPulsarConsumerProcessor()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
init
@OnScheduled public void init(org.apache.nifi.processor.ProcessContext context) -
shutDown
@OnUnscheduled public void shutDown(org.apache.nifi.processor.ProcessContext context) -
cleanUp
@OnStopped public void cleanUp(org.apache.nifi.processor.ProcessContext context) -
getConsumerId
protected String getConsumerId(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile) Method returns a string that uniquely identifies a consumer by concatenating the topic name and subscription properties together.- Parameters:
context- - The Processor contextflowFile- - The current NiFi flow file- Returns:
- The consumer id.
-
consumeAsync
protected void consumeAsync(org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord> consumer, org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.pulsar.client.api.PulsarClientException - Throws:
org.apache.pulsar.client.api.PulsarClientException
-
getConsumer
protected org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord> getConsumer(org.apache.nifi.processor.ProcessContext context, String topic) throws org.apache.pulsar.client.api.PulsarClientException - Throws:
org.apache.pulsar.client.api.PulsarClientException
-
getConsumerBuilder
protected org.apache.pulsar.client.api.ConsumerBuilder<org.apache.pulsar.client.api.schema.GenericRecord> getConsumerBuilder(org.apache.nifi.processor.ProcessContext context) throws org.apache.pulsar.client.api.PulsarClientException - Throws:
org.apache.pulsar.client.api.PulsarClientException
-
getConsumerPool
-
setConsumerPool
-
getConsumerService
protected ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>> getConsumerService() -
setConsumerService
protected void setConsumerService(ExecutorCompletionService<List<org.apache.pulsar.client.api.Message<org.apache.pulsar.client.api.schema.GenericRecord>>> service) -
getAckPool
-
setAckPool
-
getAckService
-
setAckService
-
getPulsarClientService
-
setPulsarClientService
-
getConsumers
protected PulsarConsumerLRUCache<String,org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> getConsumers() -
setConsumers
protected void setConsumers(PulsarConsumerLRUCache<String, org.apache.pulsar.client.api.Consumer<org.apache.pulsar.client.api.schema.GenericRecord>> consumers) -
getMappedFlowFileAttributes
-