You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yu...@apache.org on 2021/07/23 08:11:25 UTC

[iotdb] 01/02: remove path registration

This is an automated email from the ASF dual-hosted git repository.

yuyuankang pushed a commit to branch exception-master
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1484e624d49fa90758dec0a8391efaf3553b4720
Author: Ring-k <yu...@hotmail.com>
AuthorDate: Fri Jul 23 16:09:32 2021 +0800

    remove path registration
---
 .../java/org/apache/iotdb/flink/IoTDBSink.java     | 26 +---------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/IoTDBSink.java b/flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/IoTDBSink.java
index 95e40a2..8ab06c0 100644
--- a/flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/IoTDBSink.java
+++ b/flink-iotdb-connector/src/main/java/org/apache/iotdb/flink/IoTDBSink.java
@@ -19,8 +19,6 @@
 package org.apache.iotdb.flink;
 
 import org.apache.iotdb.flink.options.IoTDBSinkOptions;
-import org.apache.iotdb.rpc.StatementExecutionException;
-import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.session.pool.SessionPool;
 import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
@@ -78,7 +76,7 @@ public class IoTDBSink<IN> extends RichSinkFunction<IN> {
     initScheduler();
   }
 
-  void initSession() throws Exception {
+  void initSession() {
     pool =
         new SessionPool(
             options.getHost(),
@@ -86,28 +84,6 @@ public class IoTDBSink<IN> extends RichSinkFunction<IN> {
             options.getUser(),
             options.getPassword(),
             sessionPoolSize);
-
-    try {
-      pool.setStorageGroup(options.getStorageGroup());
-    } catch (StatementExecutionException e) {
-      if (e.getStatusCode() != TSStatusCode.PATH_ALREADY_EXIST_ERROR.getStatusCode()) {
-        throw e;
-      }
-    }
-
-    for (IoTDBSinkOptions.TimeseriesOption option : options.getTimeseriesOptionList()) {
-      if (!pool.checkTimeseriesExists(option.getPath())) {
-        try {
-          pool.createTimeseries(
-              option.getPath(), option.getDataType(), option.getEncoding(), option.getCompressor());
-        } catch (StatementExecutionException e) {
-          // path could have been created by the other process here
-          if (e.getStatusCode() != TSStatusCode.PATH_ALREADY_EXIST_ERROR.getStatusCode()) {
-            throw e;
-          }
-        }
-      }
-    }
   }
 
   void initScheduler() {