You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ay...@apache.org on 2019/10/29 07:06:20 UTC
[hadoop] branch trunk updated: HDFS-14935. Refactor
DFSNetworkTopology#isNodeInScope. Contributed by Lisheng Sun.
This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new fa4904c HDFS-14935. Refactor DFSNetworkTopology#isNodeInScope. Contributed by Lisheng Sun.
fa4904c is described below
commit fa4904cdcaaa294149a1c92465c71359407de93f
Author: Ayush Saxena <ay...@apache.org>
AuthorDate: Tue Oct 29 12:30:24 2019 +0530
HDFS-14935. Refactor DFSNetworkTopology#isNodeInScope. Contributed by Lisheng Sun.
---
.../main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java
index 886411a..bd02768 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/net/DFSNetworkTopology.java
@@ -259,10 +259,11 @@ public class DFSNetworkTopology extends NetworkTopology {
}
private boolean isNodeInScope(Node node, String scope) {
- if (!scope.endsWith("/")) {
- scope += "/";
+ if (!scope.endsWith(NodeBase.PATH_SEPARATOR_STR)) {
+ scope += NodeBase.PATH_SEPARATOR_STR;
}
- String nodeLocation = node.getNetworkLocation() + "/";
+ String nodeLocation =
+ node.getNetworkLocation() + NodeBase.PATH_SEPARATOR_STR;
return nodeLocation.startsWith(scope);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org