Class CanalAbstractSource<V>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.pulsar.io.core.Source<V>
    Direct Known Subclasses:
    CanalByteSource, CanalStringSource

    public abstract class CanalAbstractSource<V>
    extends org.apache.pulsar.io.core.PushSource<V>
    A Simple abstract class for mysql binlog sync to pulsar.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Thread.UncaughtExceptionHandler handler  
      protected boolean running  
      protected java.lang.Thread thread  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      abstract V extractValue​(java.util.List<com.alibaba.otter.canal.protocol.FlatMessage> flatMessages)  
      abstract java.lang.Long getMessageId​(com.alibaba.otter.canal.protocol.Message message)  
      void open​(java.util.Map<java.lang.String,​java.lang.Object> config, org.apache.pulsar.io.core.SourceContext sourceContext)  
      protected void process()  
      protected void start()  
      • 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
    • Field Detail

      • thread

        protected java.lang.Thread thread
      • running

        protected volatile boolean running
      • handler

        protected final java.lang.Thread.UncaughtExceptionHandler handler
    • Constructor Detail

      • CanalAbstractSource

        public CanalAbstractSource()
    • 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<V>
        Specified by:
        open in class org.apache.pulsar.io.core.PushSource<V>
        Throws:
        java.lang.Exception
      • start

        protected void start()
      • close

        public void close()
                   throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • process

        protected void process()
      • getMessageId

        public abstract java.lang.Long getMessageId​(com.alibaba.otter.canal.protocol.Message message)
      • extractValue

        public abstract V extractValue​(java.util.List<com.alibaba.otter.canal.protocol.FlatMessage> flatMessages)