Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYurongSu committed Feb 5, 2025
1 parent a05c523 commit 1497981
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ public class PipeConnectorConstant {
public static final String SINK_IOTDB_PASSWORD_KEY = "sink.password";
public static final String CONNECTOR_IOTDB_PASSWORD_DEFAULT_VALUE = "root";

public static final String CONNECTOR_TS_FILE_VALIDATION_KEY = "connector.tsfile.validation";
public static final String SINK_TS_FILE_VALIDATION_KEY = "sink.tsfile.validation";
public static final boolean CONNECTOR_TS_FILE_VALIDATION_DEFAULT_VALUE = true;

public static final String CONNECTOR_EXCEPTION_DATA_CONVERT_ON_TYPE_MISMATCH_KEY =
"connector.exception.data.convert-on-type-mismatch";
public static final String SINK_EXCEPTION_DATA_CONVERT_ON_TYPE_MISMATCH_KEY =
Expand Down Expand Up @@ -246,6 +242,11 @@ public class PipeConnectorConstant {
CONNECTOR_LOAD_TSFILE_STRATEGY_ASYNC_VALUE,
CONNECTOR_LOAD_TSFILE_STRATEGY_SYNC_VALUE)));

public static final String CONNECTOR_LOAD_TSFILE_VALIDATION_KEY =
"connector.load-tsfile-validation";
public static final String SINK_LOAD_TSFILE_VALIDATION_KEY = "sink.load-tsfile-validation";
public static final boolean CONNECTOR_LOAD_TSFILE_VALIDATION_DEFAULT_VALUE = true;

private PipeConnectorConstant() {
throw new IllegalStateException("Utility class");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_STRATEGY_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_STRATEGY_SET;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_STRATEGY_SYNC_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_VALIDATION_DEFAULT_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_VALIDATION_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_RATE_LIMIT_DEFAULT_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_RATE_LIMIT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_TS_FILE_VALIDATION_DEFAULT_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_TS_FILE_VALIDATION_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_COMPRESSOR_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_COMPRESSOR_ZSTD_LEVEL_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_EXCEPTION_CONFLICT_RECORD_IGNORED_DATA_KEY;
Expand All @@ -117,8 +117,8 @@
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_IOTDB_USER_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_BALANCE_STRATEGY_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_TSFILE_STRATEGY_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_TSFILE_VALIDATION_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_RATE_LIMIT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_TS_FILE_VALIDATION_KEY;

@TreeModel
@TableModel
Expand Down Expand Up @@ -216,8 +216,8 @@ public void validate(final PipeParameterValidator validator) throws Exception {

validateTsFile =
parameters.getBooleanOrDefault(
Arrays.asList(CONNECTOR_TS_FILE_VALIDATION_KEY, SINK_TS_FILE_VALIDATION_KEY),
CONNECTOR_TS_FILE_VALIDATION_DEFAULT_VALUE);
Arrays.asList(CONNECTOR_LOAD_TSFILE_VALIDATION_KEY, SINK_LOAD_TSFILE_VALIDATION_KEY),
CONNECTOR_LOAD_TSFILE_VALIDATION_DEFAULT_VALUE);

loadBalanceStrategy =
parameters
Expand Down

0 comments on commit 1497981

Please sign in to comment.