sunjincheng121 commented on a change in pull request #817: [IOTDB-497] Apache 
Flink Connector Support
URL: https://github.com/apache/incubator-iotdb/pull/817#discussion_r382958552
 
 

 ##########
 File path: 
flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/IoTDBSink.java
 ##########
 @@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.iotdb.flink;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.runtime.state.FunctionInitializationContext;
+import org.apache.flink.runtime.state.FunctionSnapshotContext;
+import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;
+import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;
+import org.apache.flink.streaming.api.operators.StreamingRuntimeContext;
+import org.apache.iotdb.service.rpc.thrift.TSStatus;
+import org.apache.iotdb.session.Session;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+public class IoTDBSink<IN> extends RichSinkFunction<IN> implements 
CheckpointedFunction {
+
+    private static final long serialVersionUID = 1L;
+    private static final Logger LOG = LoggerFactory.getLogger(IoTDBSink.class);
+
+    private IoTSerializationSchema<IN> serializationSchema;
+    private IoTDBOptions options;
+    private transient Session session;
+
+    private boolean batchFlushOnCheckpoint; // false by default
+    private int batchSize = 100;
 
 Review comment:
   Some times checkpoint interval is pretty long, even may 10min or more. and 
the  checkpoint is ensure do not miss data when checkpointing, but not ensure 
the SLA(such as delayed), So in this case it's better to have opportunity to 
set timer for flush data.
   
   What do you think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to