Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-1038

[Flink] setStorageGroup() should not be called every time in IoTDBSink

    XMLWordPrintableJSON

Details

    Description

      in IoTDBSink, the codes are:

        void initSession() throws Exception {
          pool = new SessionPool(options.getHost(), options.getPort(), options.getUser(),
              options.getPassword(), sessionPoolSize);
      
          pool.setStorageGroup(options.getStorageGroup());
          for (IoTDBOptions.TimeseriesOption option : options.getTimeseriesOptionList()) {
            if (!pool.checkTimeseriesExists(option.getPath())) {
              pool.createTimeseries(option.getPath(), option.getDataType(), option.getEncoding(),
                  option.getCompressor());
            }
          }
        }
      
      

      When we re-run the Flink task , IoTDBSink will try to create the storage group again and fails and then stop the program.... It is incorrect.

      solution:
      1. use try-catch to wrap the setStorageGroup()
      or,
      2. check whether the sg exist, and only create it if not exist.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hxd Xiangdong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: