HDFS-12620. Backporting HDFS-10467 to branch-2. Contributed by Inigo Goiri.
This commit is contained in:
parent
7b4b018780
commit
0f1c037618
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue