未验证 提交 eee581e1 编写于 作者: B Beyyes 提交者: GitHub

Perfect plan graph for last query scan node

上级 eb43b490
...@@ -60,6 +60,7 @@ import org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.IntoPathDescr ...@@ -60,6 +60,7 @@ import org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.IntoPathDescr
import org.apache.iotdb.tsfile.utils.Pair; import org.apache.iotdb.tsfile.utils.Pair;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.eclipse.jetty.util.StringUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -384,6 +385,9 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter ...@@ -384,6 +385,9 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
List<String> boxValue = new ArrayList<>(); List<String> boxValue = new ArrayList<>();
boxValue.add(String.format("LastQueryScan-%s", node.getPlanNodeId().getId())); boxValue.add(String.format("LastQueryScan-%s", node.getPlanNodeId().getId()));
boxValue.add(String.format("Series: %s", node.getSeriesPath())); boxValue.add(String.format("Series: %s", node.getSeriesPath()));
if (StringUtil.isNotBlank(node.getOutputViewPath())) {
boxValue.add(String.format("ViewPath: %s", node.getOutputViewPath()));
}
boxValue.add(printRegion(node.getRegionReplicaSet())); boxValue.add(printRegion(node.getRegionReplicaSet()));
return render(node, boxValue, context); return render(node, boxValue, context);
} }
...@@ -397,6 +401,9 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter ...@@ -397,6 +401,9 @@ public class PlanGraphPrinter extends PlanVisitor<List<String>, PlanGraphPrinter
String.format( String.format(
"Series: %s%s", "Series: %s%s",
node.getSeriesPath().getDevice(), node.getSeriesPath().getMeasurementList())); node.getSeriesPath().getDevice(), node.getSeriesPath().getMeasurementList()));
if (StringUtil.isNotBlank(node.getOutputViewPath())) {
boxValue.add(String.format("ViewPath: %s", node.getOutputViewPath()));
}
boxValue.add(printRegion(node.getRegionReplicaSet())); boxValue.add(printRegion(node.getRegionReplicaSet()));
return render(node, boxValue, context); return render(node, boxValue, context);
} }
......
...@@ -32,6 +32,7 @@ import org.apache.iotdb.tsfile.read.filter.basic.Filter; ...@@ -32,6 +32,7 @@ import org.apache.iotdb.tsfile.read.filter.basic.Filter;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.eclipse.jetty.util.StringUtil;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
...@@ -158,11 +159,20 @@ public class AlignedLastQueryScanNode extends LastSeriesSourceNode { ...@@ -158,11 +159,20 @@ public class AlignedLastQueryScanNode extends LastSeriesSourceNode {
@Override @Override
public String toString() { public String toString() {
return String.format( if (StringUtil.isNotBlank(outputViewPath)) {
"AlignedLastQueryScanNode-%s:[SeriesPath: %s, DataRegion: %s]", return String.format(
this.getPlanNodeId(), "AlignedLastQueryScanNode-%s:[SeriesPath: %s, ViewPath: %s, DataRegion: %s]",
this.getSeriesPath().getFormattedString(), this.getPlanNodeId(),
PlanNodeUtil.printRegionReplicaSet(this.getRegionReplicaSet())); this.getSeriesPath().getFormattedString(),
this.getOutputViewPath(),
PlanNodeUtil.printRegionReplicaSet(this.getRegionReplicaSet()));
} else {
return String.format(
"AlignedLastQueryScanNode-%s:[SeriesPath: %s, DataRegion: %s]",
this.getPlanNodeId(),
this.getSeriesPath().getFormattedString(),
PlanNodeUtil.printRegionReplicaSet(this.getRegionReplicaSet()));
}
} }
@Override @Override
......
...@@ -32,6 +32,7 @@ import org.apache.iotdb.tsfile.read.filter.basic.Filter; ...@@ -32,6 +32,7 @@ import org.apache.iotdb.tsfile.read.filter.basic.Filter;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils; import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import org.eclipse.jetty.util.StringUtil;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
...@@ -164,11 +165,20 @@ public class LastQueryScanNode extends LastSeriesSourceNode { ...@@ -164,11 +165,20 @@ public class LastQueryScanNode extends LastSeriesSourceNode {
@Override @Override
public String toString() { public String toString() {
return String.format( if (StringUtil.isNotBlank(outputViewPath)) {
"LastQueryScanNode-%s:[SeriesPath: %s, DataRegion: %s]", return String.format(
this.getPlanNodeId(), "LastQueryScanNode-%s:[SeriesPath: %s, ViewPath: %s, DataRegion: %s]",
this.getSeriesPath(), this.getPlanNodeId(),
PlanNodeUtil.printRegionReplicaSet(getRegionReplicaSet())); this.getSeriesPath(),
this.getOutputViewPath(),
PlanNodeUtil.printRegionReplicaSet(getRegionReplicaSet()));
} else {
return String.format(
"LastQueryScanNode-%s:[SeriesPath: %s, DataRegion: %s]",
this.getPlanNodeId(),
this.getSeriesPath(),
PlanNodeUtil.printRegionReplicaSet(getRegionReplicaSet()));
}
} }
@Override @Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册