Class MongoSource

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.pulsar.io.core.Source<byte[]>

    public class MongoSource
    extends org.apache.pulsar.io.core.PushSource<byte[]>
    The base class for MongoDB sources.
    • Constructor Summary

      Constructors 
      Constructor Description
      MongoSource()  
      MongoSource​(java.util.function.Supplier<com.mongodb.reactivestreams.client.MongoClient> clientProvider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void open​(java.util.Map<java.lang.String,​java.lang.Object> config, org.apache.pulsar.io.core.SourceContext sourceContext)  
      • Methods inherited from class org.apache.pulsar.io.core.PushSource

        consume, getQueueLength, read
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MongoSource

        public MongoSource()
      • MongoSource

        public MongoSource​(java.util.function.Supplier<com.mongodb.reactivestreams.client.MongoClient> clientProvider)
    • Method Detail

      • open

        public void open​(java.util.Map<java.lang.String,​java.lang.Object> config,
                         org.apache.pulsar.io.core.SourceContext sourceContext)
                  throws java.lang.Exception
        Specified by:
        open in interface org.apache.pulsar.io.core.Source<byte[]>
        Specified by:
        open in class org.apache.pulsar.io.core.PushSource<byte[]>
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception