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/04/12 08:03:37 UTC

[iotdb] branch xingtanzjr/graph_visitor updated (6badf76ed4 -> 924cb44704)

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a change to branch xingtanzjr/graph_visitor
in repository https://gitbox.apache.org/repos/asf/iotdb.git


 discard 6badf76ed4 spotless
     new 924cb44704 spotless

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6badf76ed4)
            \
             N -- N -- N   refs/heads/xingtanzjr/graph_visitor (924cb44704)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../apache/iotdb/db/mpp/sql/planner/plan/node/PlanGraphPrinter.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


[iotdb] 01/01: spotless

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch xingtanzjr/graph_visitor
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 924cb44704ab54d316be76db0996ae8eb9a603bd
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Tue Apr 12 16:00:14 2022 +0800

    spotless
---
 .../mpp/sql/planner/plan/node/PlanGraphPrinter.java | 21 ++++++++++-----------
 .../db/mpp/sql/planner/plan/node/PlanNode.java      |  3 +--
 .../db/mpp/sql/plan/DistributionPlannerTest.java    |  2 --
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanGraphPrinter.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanGraphPrinter.java
index 660f51d1e9..f0f6529e55 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanGraphPrinter.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanGraphPrinter.java
@@ -19,13 +19,14 @@
 
 package org.apache.iotdb.db.mpp.sql.planner.plan.node;
 
-import org.apache.commons.lang3.Validate;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.ExchangeNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.LimitNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.TimeJoinNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.sink.FragmentSinkNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.source.SeriesScanNode;
 
+import org.apache.commons.lang3.Validate;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -59,7 +60,7 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
     List<String> boxValue = new ArrayList<>();
     boxValue.add(String.format("SeriesScanNode-%s", node.getPlanNodeId().getId()));
     boxValue.add(String.format("Series: %s", node.getSeriesPath()));
-    boxValue.add(String.format("Region: %s", node.getDataRegionReplicaSet().getId()));
+    boxValue.add(String.format("Partition: %s", node.getDataRegionReplicaSet().getId()));
     return render(node, boxValue, context);
   }
 
@@ -74,6 +75,7 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
   public List<String> visitTimeJoin(TimeJoinNode node, GraphContext context) {
     List<String> boxValue = new ArrayList<>();
     boxValue.add(String.format("TimeJoinNode-%s", node.getPlanNodeId().getId()));
+    boxValue.add(String.format("Order: %s", node.getMergeOrder()));
     return render(node, boxValue, context);
   }
 
@@ -96,7 +98,7 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
   private List<String> render(PlanNode node, List<String> nodeBoxString, GraphContext context) {
     Box box = new Box(nodeBoxString);
     List<List<String>> children = new ArrayList<>();
-    for(PlanNode child : node.getChildren()) {
+    for (PlanNode child : node.getChildren()) {
       children.add(child.accept(this, context));
     }
     box.calculateBoxParams(children);
@@ -156,7 +158,8 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
       }
       StringBuilder line1 = new StringBuilder();
       for (int i = 0; i < box.lineWidth; i++) {
-        if (i < getChildMidPosition(children, 0) || i > getChildMidPosition(children, children.size() - 1)) {
+        if (i < getChildMidPosition(children, 0)
+            || i > getChildMidPosition(children, children.size() - 1)) {
           line1.append(INDENT);
           continue;
         }
@@ -281,7 +284,7 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
       int childrenWidth = 0;
       for (List<String> childBoxString : childBoxStrings) {
         Validate.isTrue(childBoxString.size() > 0, "Lines of box string should be greater than 0");
-        childrenWidth +=childBoxString.get(0).length();
+        childrenWidth += childBoxString.get(0).length();
       }
       childrenWidth += childBoxStrings.size() > 1 ? (childBoxStrings.size() - 1) * BOX_MARGIN : 0;
       this.lineWidth = Math.max(this.boxWidth, childrenWidth);
@@ -291,9 +294,7 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
     }
   }
 
-  public static class GraphContext {
-
-  }
+  public static class GraphContext {}
 
   public static List<String> getGraph(PlanNode node) {
     return node.accept(new PlanGraphPrinter(), new PlanGraphPrinter.GraphContext());
@@ -301,10 +302,8 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
 
   public static void print(PlanNode node) {
     List<String> lines = getGraph(node);
-    for(String line : lines) {
+    for (String line : lines) {
       System.out.println(line);
     }
   }
 }
-
-
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanNode.java
index 6636a5b41d..8f9734123c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/PlanNode.java
@@ -18,10 +18,9 @@
  */
 package org.apache.iotdb.db.mpp.sql.planner.plan.node;
 
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 
+import com.google.common.collect.ImmutableList;
 import org.apache.commons.lang.Validate;
 
 import java.nio.ByteBuffer;
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/DistributionPlannerTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/DistributionPlannerTest.java
index f68f1f8c36..68b12abb0e 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/DistributionPlannerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/DistributionPlannerTest.java
@@ -34,10 +34,8 @@ import org.apache.iotdb.db.mpp.sql.analyze.Analysis;
 import org.apache.iotdb.db.mpp.sql.analyze.QueryType;
 import org.apache.iotdb.db.mpp.sql.planner.DistributionPlanner;
 import org.apache.iotdb.db.mpp.sql.planner.plan.DistributedQueryPlan;
-import org.apache.iotdb.db.mpp.sql.planner.plan.FragmentInstance;
 import org.apache.iotdb.db.mpp.sql.planner.plan.LogicalQueryPlan;
 import org.apache.iotdb.db.mpp.sql.planner.plan.SubPlan;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.PlanGraphPrinter;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.PlanNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.LimitNode;
 import org.apache.iotdb.db.mpp.sql.planner.plan.node.process.TimeJoinNode;