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/07/29 06:57:20 UTC
[iotdb] branch ml_0729_test updated: fake target location
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch ml_0729_test
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/ml_0729_test by this push:
new 51503f3f25 fake target location
51503f3f25 is described below
commit 51503f3f25fc99e0aefe0228659313e1db0bd86f
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Fri Jul 29 14:56:57 2022 +0800
fake target location
---
.../planner/distribution/SimpleFragmentParallelPlanner.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SimpleFragmentParallelPlanner.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SimpleFragmentParallelPlanner.java
index 854bb15467..f9398fc598 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SimpleFragmentParallelPlanner.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SimpleFragmentParallelPlanner.java
@@ -103,13 +103,24 @@ public class SimpleFragmentParallelPlanner implements IFragmentParallelPlaner {
// redirected
// to another host when scheduling
fragmentInstance.setDataRegionAndHost(regionReplicaSet);
- fragmentInstance.setHostDataNode(selectTargetDataNode(regionReplicaSet));
+ fragmentInstance.setHostDataNode(fakeSelectDataNode(regionReplicaSet));
fragmentInstance.getFragment().setTypeProvider(analysis.getTypeProvider());
instanceMap.putIfAbsent(fragment.getId(), fragmentInstance);
fragmentInstanceList.add(fragmentInstance);
}
+ private TDataNodeLocation fakeSelectDataNode(TRegionReplicaSet regionReplicaSet) {
+ String[] candidate = new String[] {"172.20.31.41", "172.20.31.42", "172.20.31.43"};
+ int targetIndex = regionReplicaSet.regionId.id % 3;
+ for (TDataNodeLocation location : regionReplicaSet.getDataNodeLocations()) {
+ if (location.internalEndPoint.getIp().equals(candidate[targetIndex])) {
+ return location;
+ }
+ }
+ return null;
+ }
+
private TDataNodeLocation selectTargetDataNode(TRegionReplicaSet regionReplicaSet) {
if (regionReplicaSet == null
|| regionReplicaSet.getDataNodeLocations() == null