You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/07/23 10:45:33 UTC
[iotdb] branch master updated: Remove path registration in
IoTDBSink (#3620)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 469f78b Remove path registration in IoTDBSink (#3620)
469f78b is described below
commit 469f78b9d43dca18edbe42188128893e27d41d91
Author: Ring-k <36...@users.noreply.github.com>
AuthorDate: Fri Jul 23 18:45:14 2021 +0800
Remove path registration in IoTDBSink (#3620)
---
.../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() {