|
101 | 101 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_STRATEGY_SYNC_VALUE; |
102 | 102 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_VALIDATION_DEFAULT_VALUE; |
103 | 103 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_LOAD_TSFILE_VALIDATION_KEY; |
| 104 | +import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_MARK_AS_GENERAL_WRITE_REQUEST_DEFAULT_VALUE; |
| 105 | +import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_MARK_AS_GENERAL_WRITE_REQUEST_KEY; |
104 | 106 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_MARK_AS_PIPE_REQUEST_DEFAULT_VALUE; |
105 | 107 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_MARK_AS_PIPE_REQUEST_KEY; |
106 | 108 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.CONNECTOR_RATE_LIMIT_DEFAULT_VALUE; |
|
130 | 132 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_BALANCE_STRATEGY_KEY; |
131 | 133 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_TSFILE_STRATEGY_KEY; |
132 | 134 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_LOAD_TSFILE_VALIDATION_KEY; |
| 135 | +import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_MARK_AS_GENERAL_WRITE_REQUEST_KEY; |
133 | 136 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_MARK_AS_PIPE_REQUEST_KEY; |
134 | 137 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_RATE_LIMIT_KEY; |
135 | 138 | import static org.apache.iotdb.commons.pipe.config.constant.PipeConnectorConstant.SINK_SKIP_IF_KEY; |
@@ -225,6 +228,13 @@ public void validate(final PipeParameterValidator validator) throws Exception { |
225 | 228 | Arrays.asList(CONNECTOR_IOTDB_BATCH_DELAY_KEY, SINK_IOTDB_BATCH_DELAY_KEY), |
226 | 229 | false); |
227 | 230 |
|
| 231 | + // Check coexistence of mark-as-pipe-request and mark-as-general-write-request |
| 232 | + validator.validateSynonymAttributes( |
| 233 | + Arrays.asList(CONNECTOR_MARK_AS_PIPE_REQUEST_KEY, SINK_MARK_AS_PIPE_REQUEST_KEY), |
| 234 | + Arrays.asList( |
| 235 | + CONNECTOR_MARK_AS_GENERAL_WRITE_REQUEST_KEY, SINK_MARK_AS_GENERAL_WRITE_REQUEST_KEY), |
| 236 | + false); |
| 237 | + |
228 | 238 | username = |
229 | 239 | parameters.getStringOrDefault( |
230 | 240 | Arrays.asList( |
@@ -379,10 +389,20 @@ public void customize( |
379 | 389 | .equals(CONNECTOR_FORMAT_TS_FILE_VALUE); |
380 | 390 | LOGGER.info("IoTDBConnector isTabletBatchModeEnabled: {}", isTabletBatchModeEnabled); |
381 | 391 |
|
382 | | - shouldMarkAsPipeRequest = |
| 392 | + final boolean shouldMarkAsGeneralWriteRequest = |
383 | 393 | parameters.getBooleanOrDefault( |
384 | | - Arrays.asList(CONNECTOR_MARK_AS_PIPE_REQUEST_KEY, SINK_MARK_AS_PIPE_REQUEST_KEY), |
385 | | - CONNECTOR_MARK_AS_PIPE_REQUEST_DEFAULT_VALUE); |
| 394 | + Arrays.asList( |
| 395 | + CONNECTOR_MARK_AS_GENERAL_WRITE_REQUEST_KEY, |
| 396 | + SINK_MARK_AS_GENERAL_WRITE_REQUEST_KEY), |
| 397 | + CONNECTOR_MARK_AS_GENERAL_WRITE_REQUEST_DEFAULT_VALUE); |
| 398 | + if (shouldMarkAsGeneralWriteRequest) { |
| 399 | + shouldMarkAsPipeRequest = false; |
| 400 | + } else { |
| 401 | + shouldMarkAsPipeRequest = |
| 402 | + parameters.getBooleanOrDefault( |
| 403 | + Arrays.asList(CONNECTOR_MARK_AS_PIPE_REQUEST_KEY, SINK_MARK_AS_PIPE_REQUEST_KEY), |
| 404 | + CONNECTOR_MARK_AS_PIPE_REQUEST_DEFAULT_VALUE); |
| 405 | + } |
386 | 406 | LOGGER.info("IoTDBConnector shouldMarkAsPipeRequest: {}", shouldMarkAsPipeRequest); |
387 | 407 |
|
388 | 408 | final String connectorSkipIfValue = |
|
0 commit comments