void compareBLs(BlockLocation[] viewBL, BlockLocation[] targetBL) { Assert.assertEquals(targetBL.length, viewBL.length); int i = 0; for (BlockLocation vbl : viewBL) { Assert.assertEquals(vbl.toString(), targetBL[i].toString()); Assert.assertEquals(targetBL[i].getOffset(), vbl.getOffset()); Assert.assertEquals(targetBL[i].getLength(), vbl.getLength()); i++; } }
void compareBLs(BlockLocation[] viewBL, BlockLocation[] targetBL) { Assert.assertEquals(targetBL.length, viewBL.length); int i = 0; for (BlockLocation vbl : viewBL) { Assert.assertEquals(vbl.toString(), targetBL[i].toString()); Assert.assertEquals(targetBL[i].getOffset(), vbl.getOffset()); Assert.assertEquals(targetBL[i].getLength(), vbl.getLength()); i++; } }
void compareBLs(BlockLocation[] viewBL, BlockLocation[] targetBL) { Assert.assertEquals(targetBL.length, viewBL.length); int i = 0; for (BlockLocation vbl : viewBL) { Assert.assertEquals(vbl.toString(), targetBL[i].toString()); Assert.assertEquals(targetBL[i].getOffset(), vbl.getOffset()); Assert.assertEquals(targetBL[i].getLength(), vbl.getLength()); i++; } }
void compareBLs(BlockLocation[] viewBL, BlockLocation[] targetBL) { Assert.assertEquals(targetBL.length, viewBL.length); int i = 0; for (BlockLocation vbl : viewBL) { Assert.assertEquals(vbl.toString(), targetBL[i].toString()); Assert.assertEquals(targetBL[i].getOffset(), vbl.getOffset()); Assert.assertEquals(targetBL[i].getLength(), vbl.getLength()); i++; } }
public void testGetFileBlockLocations() throws IOException { final String f = "/test/testGetFileBlockLocations"; createFile(path(f)); final BlockLocation[] computed = fs.getFileBlockLocations(new Path(f), 0L, 1L); final BlockLocation[] expected = cluster.getFileSystem().getFileBlockLocations( new Path(f), 0L, 1L); assertEquals(expected.length, computed.length); for (int i = 0; i < computed.length; i++) { assertEquals(expected[i].toString(), computed[i].toString()); // Check names String names1[] = expected[i].getNames(); String names2[] = computed[i].getNames(); Arrays.sort(names1); Arrays.sort(names2); Assert.assertArrayEquals("Names differ", names1, names2); // Check topology String topos1[] = expected[i].getTopologyPaths(); String topos2[] = computed[i].getTopologyPaths(); Arrays.sort(topos1); Arrays.sort(topos2); Assert.assertArrayEquals("Topology differs", topos1, topos2); } }