hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viraj...@apache.org
Subject [10/50] [abbrv] hadoop git commit: HDFS-12620. Backporting HDFS-10467 to branch-2. Contributed by Inigo Goiri.
Date Tue, 24 Oct 2017 18:31:44 GMT
HDFS-12620. Backporting HDFS-10467 to branch-2. Contributed by Inigo Goiri.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0f1c0376
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0f1c0376
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0f1c0376

Branch: refs/heads/HDFS-9806
Commit: 0f1c0376186de6446d595be7bb445ed6b71ae499
Parents: 7b4b018
Author: Inigo Goiri <inigoiri@apache.org>
Authored: Thu Oct 19 18:08:45 2017 -0700
Committer: Inigo Goiri <inigoiri@apache.org>
Committed: Thu Oct 19 18:08:45 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/server/federation/MockResolver.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0f1c0376/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
index a481553..151d731 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java
@@ -264,7 +264,10 @@ public class MockResolver
   @Override
   public PathLocation getDestinationForPath(String path) throws IOException {
     List<RemoteLocation> remoteLocations = new LinkedList<>();
-    for (String key : this.locations.keySet()) {
+    // We go from the leaves to the root
+    List<String> keys = new ArrayList<>(this.locations.keySet());
+    Collections.sort(keys, Collections.reverseOrder());
+    for (String key : keys) {
       if (path.startsWith(key)) {
         for (RemoteLocation location : this.locations.get(key)) {
           String finalPath = location.getDest() + path.substring(key.length());


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message