|
@@ -20,6 +20,7 @@ package org.apache.hadoop.hdfs.server.blockmanagement;
|
|
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
+import static org.junit.Assert.assertArrayEquals;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
@@ -202,7 +203,7 @@ public class TestBlocksWithNotEnoughRacks {
|
|
|
final FileSystem fs = cluster.getFileSystem();
|
|
|
|
|
|
DFSTestUtil.createFile(fs, filePath, fileLen, REPLICATION_FACTOR, 1L);
|
|
|
- final String fileContent = DFSTestUtil.readFile(fs, filePath);
|
|
|
+ final byte[] fileContent = DFSTestUtil.readFileAsBytes(fs, filePath);
|
|
|
|
|
|
ExtendedBlock b = DFSTestUtil.getFirstBlock(fs, filePath);
|
|
|
DFSTestUtil.waitForReplication(cluster, b, 2, REPLICATION_FACTOR, 0);
|
|
@@ -224,9 +225,9 @@ public class TestBlocksWithNotEnoughRacks {
|
|
|
// Ensure all replicas are valid (the corrupt replica may not
|
|
|
// have been cleaned up yet).
|
|
|
for (int i = 0; i < racks.length; i++) {
|
|
|
- String blockContent = cluster.readBlockOnDataNode(i, b);
|
|
|
+ byte[] blockContent = cluster.readBlockOnDataNodeAsBytes(i, b);
|
|
|
if (blockContent != null && i != dnToCorrupt) {
|
|
|
- assertEquals("Corrupt replica", fileContent, blockContent);
|
|
|
+ assertArrayEquals("Corrupt replica", fileContent, blockContent);
|
|
|
}
|
|
|
}
|
|
|
} finally {
|