You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/03/28 09:45:47 UTC
[iotdb] branch xingtanzjr/polish_node created (now 37e268c)
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a change to branch xingtanzjr/polish_node
in repository https://gitbox.apache.org/repos/asf/iotdb.git.
at 37e268c fix the bug in distribution planner
This branch includes the following new commits:
new 37e268c fix the bug in distribution planner
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 01/01: fix the bug in distribution planner
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/polish_node
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 37e268cab58214cdaf22f1e59a1f66489def2cf0
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Mon Mar 28 17:44:29 2022 +0800
fix the bug in distribution planner
---
.../mpp/sql/planner/plan/node/process/ExchangeNode.java | 4 +++-
.../mpp/sql/planner/plan/node/sink/FragmentSinkNode.java | 15 +++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/process/ExchangeNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/process/ExchangeNode.java
index 80bbf41..0df6d36 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/process/ExchangeNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/process/ExchangeNode.java
@@ -60,7 +60,9 @@ public class ExchangeNode extends PlanNode {
public PlanNode clone() {
ExchangeNode node = new ExchangeNode(getId());
if (remoteSourceNode != null) {
- node.setRemoteSourceNode((FragmentSinkNode) remoteSourceNode.clone());
+ FragmentSinkNode remoteSourceNodeClone = (FragmentSinkNode) remoteSourceNode.clone();
+ remoteSourceNodeClone.setDownStreamNode(node);
+ node.setRemoteSourceNode(remoteSourceNode);
}
return node;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/sink/FragmentSinkNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/sink/FragmentSinkNode.java
index 3ab12c7..aeb129f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/sink/FragmentSinkNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/sink/FragmentSinkNode.java
@@ -25,6 +25,7 @@ import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.ExchangeNode;
import org.apache.iotdb.service.rpc.thrift.EndPoint;
import com.google.common.collect.ImmutableList;
+import org.apache.commons.lang.Validate;
import java.nio.ByteBuffer;
import java.util.List;
@@ -51,12 +52,22 @@ public class FragmentSinkNode extends SinkNode {
@Override
public PlanNode clone() {
- return null;
+ FragmentSinkNode sinkNode = new FragmentSinkNode(getId());
+ sinkNode.setDownStream(downStreamEndpoint, downStreamInstanceId, downStreamPlanNodeId);
+ sinkNode.setDownStreamNode(downStreamNode);
+ return sinkNode;
}
@Override
public PlanNode cloneWithChildren(List<PlanNode> children) {
- return null;
+ Validate.isTrue(
+ children == null || children.size() == 1,
+ "Children size of FragmentSinkNode should be 0 or 1");
+ FragmentSinkNode sinkNode = (FragmentSinkNode) clone();
+ if (children != null) {
+ sinkNode.setChild(children.get(0));
+ }
+ return sinkNode;
}
@Override