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