Class PulsarSource<T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.pulsar.io.core.Source<T>
    Direct Known Subclasses:
    PushPulsarSource, SingleConsumerPulsarSource

    public abstract class PulsarSource<T>
    extends java.lang.Object
    implements org.apache.pulsar.io.core.Source<T>
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PulsarSource​(org.apache.pulsar.client.api.PulsarClient pulsarClient, PulsarSourceConfig pulsarSourceConfig, java.util.Map<java.lang.String,​java.lang.String> properties, java.lang.ClassLoader functionClassLoader)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.pulsar.functions.source.PulsarSourceConsumerConfig<T> buildPulsarSourceConsumerConfig​(java.lang.String topic, org.apache.pulsar.common.functions.ConsumerConfig conf, java.lang.Class<?> typeArg)  
      protected org.apache.pulsar.functions.api.Record<T> buildRecord​(org.apache.pulsar.client.api.Consumer<T> consumer, org.apache.pulsar.client.api.Message<T> message)  
      protected org.apache.pulsar.client.api.ConsumerBuilder<T> createConsumeBuilder​(java.lang.String topic, org.apache.pulsar.functions.source.PulsarSourceConsumerConfig conf)  
      abstract java.util.List<org.apache.pulsar.client.api.Consumer<T>> getInputConsumers()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.AutoCloseable

        close
      • Methods inherited from interface org.apache.pulsar.io.core.Source

        open, read
    • Field Detail

      • pulsarClient

        protected final org.apache.pulsar.client.api.PulsarClient pulsarClient
      • properties

        protected final java.util.Map<java.lang.String,​java.lang.String> properties
      • functionClassLoader

        protected final java.lang.ClassLoader functionClassLoader
    • Constructor Detail

      • PulsarSource

        protected PulsarSource​(org.apache.pulsar.client.api.PulsarClient pulsarClient,
                               PulsarSourceConfig pulsarSourceConfig,
                               java.util.Map<java.lang.String,​java.lang.String> properties,
                               java.lang.ClassLoader functionClassLoader)
    • Method Detail

      • getInputConsumers

        public abstract java.util.List<org.apache.pulsar.client.api.Consumer<T>> getInputConsumers()
      • createConsumeBuilder

        protected org.apache.pulsar.client.api.ConsumerBuilder<T> createConsumeBuilder​(java.lang.String topic,
                                                                                       org.apache.pulsar.functions.source.PulsarSourceConsumerConfig conf)
      • buildRecord

        protected org.apache.pulsar.functions.api.Record<T> buildRecord​(org.apache.pulsar.client.api.Consumer<T> consumer,
                                                                        org.apache.pulsar.client.api.Message<T> message)
      • buildPulsarSourceConsumerConfig

        protected org.apache.pulsar.functions.source.PulsarSourceConsumerConfig<T> buildPulsarSourceConsumerConfig​(java.lang.String topic,
                                                                                                                   org.apache.pulsar.common.functions.ConsumerConfig conf,
                                                                                                                   java.lang.Class<?> typeArg)