Class IoTDBSink<IN>

  • Type Parameters:
    IN - the input data type
    All Implemented Interfaces:
    java.io.Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.streaming.api.functions.sink.SinkFunction<IN>

    public class IoTDBSink<IN>
    extends org.apache.flink.streaming.api.functions.sink.RichSinkFunction<IN>
    The `IoTDBSink` allows flink jobs to write events into IoTDB timeseries. By default send only one event after another, but you can change to batch by invoking `withBatchSize(int)`.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.sink.SinkFunction

        org.apache.flink.streaming.api.functions.sink.SinkFunction.Context
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void invoke​(IN input, org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context)  
      void open​(org.apache.flink.configuration.Configuration parameters)  
      IoTDBSink<IN> withBatchSize​(int batchSize)  
      IoTDBSink<IN> withFlushIntervalMs​(int flushIntervalMs)  
      IoTDBSink<IN> withSessionPoolSize​(int sessionPoolSize)  
      • Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

        getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.flink.streaming.api.functions.sink.SinkFunction

        finish, invoke, writeWatermark
    • Method Detail

      • open

        public void open​(org.apache.flink.configuration.Configuration parameters)
                  throws java.lang.Exception
        Specified by:
        open in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        open in class org.apache.flink.api.common.functions.AbstractRichFunction
        Throws:
        java.lang.Exception
      • invoke

        public void invoke​(IN input,
                           org.apache.flink.streaming.api.functions.sink.SinkFunction.Context context)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • withBatchSize

        public IoTDBSink<IN> withBatchSize​(int batchSize)
      • withFlushIntervalMs

        public IoTDBSink<IN> withFlushIntervalMs​(int flushIntervalMs)
      • withSessionPoolSize

        public IoTDBSink<IN> withSessionPoolSize​(int sessionPoolSize)
      • close

        public void close()
        Specified by:
        close in interface org.apache.flink.api.common.functions.RichFunction
        Overrides:
        close in class org.apache.flink.api.common.functions.AbstractRichFunction