SteveYurongSu commented on code in PR #12217:
URL: https://github.com/apache/iotdb/pull/12217#discussion_r1538820547
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java:
##########
@@ -1034,10 +1038,80 @@ public TPushPipeMetaResp
pushSinglePipeMeta(TPushSinglePipeMetaReq req) {
}
}
+ @Override
+ public TPushPipeMetaResp pushMultiPipeMeta(TPushMultiPipeMetaReq req) {
+ boolean hasException = false;
+ // If there is any exception, we use the size of exceptionMessages to
record the fail index
+ List<TPushPipeMetaRespExceptionMessage> exceptionMessages = new
ArrayList<>();
+ try {
+ if (req.isSetPipeNamesToDrop()) {
+ for (String pipeNameToDrop : req.getPipeNamesToDrop()) {
+ TPushPipeMetaRespExceptionMessage message =
+ PipeAgent.task().handleDropPipe(pipeNameToDrop);
+ exceptionMessages.add(message);
+ if (message != null) {
+ // If there is any exception, skip the remaining pipes
+ hasException = true;
+ break;
+ }
+ }
+ } else if (req.isSetPipeMetas()) {
+ for (ByteBuffer byteBuffer : req.getPipeMetas()) {
+ final PipeMeta pipeMeta = PipeMeta.deserialize(byteBuffer);
+ TPushPipeMetaRespExceptionMessage message =
+ PipeAgent.task().handleSinglePipeMetaChanges(pipeMeta);
+ exceptionMessages.add(message);
+ if (message != null) {
+ // If there is any exception, skip the remaining pipes
+ hasException = true;
+ break;
+ }
+ }
+ } else {
+ throw new Exception("Invalid TPushMultiPipeMetaReq");
+ }
+
+ return hasException
+ ? new TPushPipeMetaResp()
+ .setStatus(new
TSStatus(TSStatusCode.PIPE_PUSH_META_ERROR.getStatusCode()))
+ .setExceptionMessages(exceptionMessages)
+ : new TPushPipeMetaResp()
+ .setStatus(new
TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+ } catch (Exception e) {
+ LOGGER.error("Error occurred when pushing multi pipe meta", e);
Review Comment:
```suggestion
LOGGER.warn("Error occurred when pushing multi pipe meta", e);
```
--
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]