From f97c00fd99609214830e68f52c1ec48c4e506c1c Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Mon, 9 Feb 2015 17:14:02 -0800 Subject: [PATCH] HBASE-12998 Compilation with Hdfs-2.7.0-SNAPSHOT is broken after HDFS-7647 --- .../org/apache/hadoop/hbase/fs/TestBlockReorder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java index db751b22fd4..613d1ea92aa 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/fs/TestBlockReorder.java @@ -175,11 +175,12 @@ public class TestBlockReorder { public void reorderBlocks(Configuration c, LocatedBlocks lbs, String src) { for (LocatedBlock lb : lbs.getLocatedBlocks()) { 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"); - DatanodeInfo tmp = lb.getLocations()[0]; - lb.getLocations()[0] = lb.getLocations()[1]; - lb.getLocations()[1] = tmp; + DatanodeInfo tmp = infos[0]; + infos[0] = infos[1]; + infos[1] = tmp; } } }