HBASE-12998 Compilation with Hdfs-2.7.0-SNAPSHOT is broken after HDFS-7647
This commit is contained in:
parent
1e6afa2f3c
commit
f97c00fd99
|
@ -175,11 +175,12 @@ public class TestBlockReorder {
|
||||||
public void reorderBlocks(Configuration c, LocatedBlocks lbs, String src) {
|
public void reorderBlocks(Configuration c, LocatedBlocks lbs, String src) {
|
||||||
for (LocatedBlock lb : lbs.getLocatedBlocks()) {
|
for (LocatedBlock lb : lbs.getLocatedBlocks()) {
|
||||||
if (lb.getLocations().length > 1) {
|
if (lb.getLocations().length > 1) {
|
||||||
if (lb.getLocations()[0].getHostName().equals(lookup)) {
|
DatanodeInfo[] infos = lb.getLocations();
|
||||||
|
if (infos[0].getHostName().equals(lookup)) {
|
||||||
LOG.info("HFileSystem bad host, inverting");
|
LOG.info("HFileSystem bad host, inverting");
|
||||||
DatanodeInfo tmp = lb.getLocations()[0];
|
DatanodeInfo tmp = infos[0];
|
||||||
lb.getLocations()[0] = lb.getLocations()[1];
|
infos[0] = infos[1];
|
||||||
lb.getLocations()[1] = tmp;
|
infos[1] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue