Skip to content

Commit

Permalink
remove EXTRACTOR_CAPTURE_TREE_PATH_KEY related
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYurongSu committed Oct 18, 2024
1 parent 1a1c678 commit 7f9c265
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;

import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_CAPTURE_TREE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_END_TIME_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_HISTORY_ENABLE_DEFAULT_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_HISTORY_ENABLE_KEY;
Expand All @@ -75,7 +74,6 @@
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_MODE_STRICT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_MODS_ENABLE_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_MODS_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_IOTDB_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_PREFIX_VALUE;
Expand All @@ -92,7 +90,6 @@
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_START_TIME_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_WATERMARK_INTERVAL_DEFAULT_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_WATERMARK_INTERVAL_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_CAPTURE_TREE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_END_TIME_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_HISTORY_ENABLE_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_HISTORY_END_TIME_KEY;
Expand All @@ -104,7 +101,6 @@
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_MODE_STRICT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_MODS_ENABLE_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_MODS_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_PATTERN_FORMAT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_REALTIME_ENABLE_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_REALTIME_LOOSE_RANGE_KEY;
Expand Down Expand Up @@ -158,8 +154,6 @@ public void validate(final PipeParameterValidator validator) throws Exception {
&& validator
.getParameters()
.hasAnyAttributes(
PipeExtractorConstant.EXTRACTOR_CAPTURE_TREE_PATH_KEY,
PipeExtractorConstant.SOURCE_CAPTURE_TREE_PATH_KEY,
PipeExtractorConstant.EXTRACTOR_PATH_KEY,
PipeExtractorConstant.SOURCE_PATH_KEY,
PipeExtractorConstant.EXTRACTOR_PATTERN_KEY,
Expand Down Expand Up @@ -380,17 +374,6 @@ private void checkInvalidParameters(final PipeParameters parameters) {
SOURCE_MODS_ENABLE_KEY);
}

// Check coexistence of capture.tree.path and path
if (parameters.hasAnyAttributes(EXTRACTOR_CAPTURE_TREE_PATH_KEY, SOURCE_CAPTURE_TREE_PATH_KEY)
&& parameters.hasAnyAttributes(EXTRACTOR_PATH_KEY, SOURCE_PATH_KEY)) {
LOGGER.warn(
"When {} or {} is specified, specifying {} and {} is invalid.",
EXTRACTOR_CAPTURE_TREE_PATH_KEY,
SOURCE_CAPTURE_TREE_PATH_KEY,
EXTRACTOR_PATH_KEY,
SOURCE_PATH_KEY);
}

// Check coexistence of watermark.interval-ms and watermark-interval-ms
if (parameters.hasAnyAttributes(EXTRACTOR_WATERMARK_INTERVAL_KEY, SOURCE_WATERMARK_INTERVAL_KEY)
&& parameters.hasAnyAttributes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ public class PipeExtractorConstant {
public static final String SOURCE_CAPTURE_TREE_KEY = "source.capture.tree";
public static final String EXTRACTOR_CAPTURE_TABLE_KEY = "extractor.capture.table";
public static final String SOURCE_CAPTURE_TABLE_KEY = "source.capture.table";
public static final String EXTRACTOR_CAPTURE_TREE_PATH_KEY = "extractor.capture.tree.path";
public static final String SOURCE_CAPTURE_TREE_PATH_KEY = "source.capture.tree.path";
public static final String SOURCE_CAPTURE_TREE_PATH_DEFAULT_VALUE = "root.**";

public static final String EXTRACTOR_INCLUSION_KEY = "extractor.inclusion";
public static final String SOURCE_INCLUSION_KEY = "source.inclusion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@
import java.util.Arrays;
import java.util.Objects;

import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_CAPTURE_TREE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_IOTDB_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_FORMAT_PREFIX_VALUE;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_PATTERN_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_CAPTURE_TREE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_PATH_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_PATTERN_FORMAT_KEY;
import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_PATTERN_KEY;
Expand Down Expand Up @@ -82,15 +80,7 @@ public static TreePattern parsePipePatternFromSourceParameters(
SystemConstant.SQL_DIALECT_KEY, SystemConstant.SQL_DIALECT_TREE_VALUE)
.equals(SystemConstant.SQL_DIALECT_TREE_VALUE));

final String path;
if (sourceParameters.hasAnyAttributes(
EXTRACTOR_CAPTURE_TREE_PATH_KEY, SOURCE_CAPTURE_TREE_PATH_KEY)) {
path =
sourceParameters.getStringByKeys(
EXTRACTOR_CAPTURE_TREE_PATH_KEY, SOURCE_CAPTURE_TREE_PATH_KEY);
} else {
path = sourceParameters.getStringByKeys(EXTRACTOR_PATH_KEY, SOURCE_PATH_KEY);
}
final String path = sourceParameters.getStringByKeys(EXTRACTOR_PATH_KEY, SOURCE_PATH_KEY);

// 1. If "source.path" is specified, it will be interpreted as an IoTDB-style path,
// ignoring the other 2 parameters.
Expand Down

0 comments on commit 7f9c265

Please sign in to comment.