jt2594838 commented on code in PR #19053:
URL: https://github.com/apache/iotdb/pull/19053#discussion_r4438390109
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java:
##########
@@ -534,6 +539,34 @@ private TPipeTransferResp handleTransferTabletInsertNode(
: executeStatementAndAddRedirectInfo(statement));
}
+ private static TPipeTransferResp pipeDataInsertionDisabledResponse() {
+ return new TPipeTransferResp(
+ RpcUtils.getStatus(
+ TSStatusCode.UNSUPPORTED_OPERATION,
+ PipeMessages
+
.MESSAGE_PIPE_DATA_INSERTION_IS_DISABLED_WHEN_DATA_REGION_CONSENSUS_PROTOCOL_IS_RATIS_7D669ECC));
+ }
+
+ private static boolean isDataInsertionRequest(final PipeRequestType
requestType) {
+ switch (requestType) {
+ case TRANSFER_TABLET_INSERT_NODE:
+ case TRANSFER_TABLET_INSERT_NODE_V2:
+ case TRANSFER_TABLET_RAW:
+ case TRANSFER_TABLET_RAW_V2:
+ case TRANSFER_TABLET_BINARY:
+ case TRANSFER_TABLET_BINARY_V2:
+ case TRANSFER_TABLET_BATCH:
+ case TRANSFER_TABLET_BATCH_V2:
+ case TRANSFER_TS_FILE_PIECE:
+ case TRANSFER_TS_FILE_SEAL:
+ case TRANSFER_TS_FILE_PIECE_WITH_MOD:
+ case TRANSFER_TS_FILE_SEAL_WITH_MOD:
+ return true;
+ default:
+ return false;
+ }
+ }
Review Comment:
Use enhanced switch without a default to avoid misusing the default value
for future types.
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/pipe/PipeTaskInfo.java:
##########
@@ -422,6 +429,17 @@ private void checkBeforeStartPipeInternal(final String
pipeName, final boolean i
}
}
+ private void checkPipeDataInsertionAvailability(final PipeStaticMeta
staticMeta) {
+ // Procedures call these validators while holding the coordinator lock.
Recheck the merged
+ // source parameters here because concurrent ALTER requests can change the
RPC-time snapshot.
+ if
(!staticMeta.getPipeName().startsWith(PipeStaticMeta.CONSENSUS_PIPE_PREFIX)
+ &&
!PipeConfigNodeAgent.isPipeDataInsertionEnabled(staticMeta.getSourceParameters()))
{
Review Comment:
The condition is a conflict because we cannot use IoTV2 and Ratis at the
same time.
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/agent/SubscriptionReceiverAgent.java:
##########
@@ -90,8 +101,11 @@ public class SubscriptionReceiverAgent {
SubscriptionReceiverAgent() {
this(
SubscriptionReceiverV1::new,
- SubscriptionConfig.getInstance().getSubscriptionEnabled(),
- () -> SubscriptionConfig.getInstance().getSubscriptionEnabled());
+ SubscriptionConfig.getInstance().getSubscriptionEnabled()
+ && PipeDataNodeAgent.isSubscriptionFeatureEnabled(),
Review Comment:
Can we merge them?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]