HDFS-3266. DFSTestUtil#waitCorruptReplicas doesn't sleep between checks. Contributed by Madhukara Phatak

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1346194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-06-04 23:34:19 +00:00
parent 068b62b9a3
commit 3f30678f76
2 changed files with 5 additions and 1 deletions

View File

@ -153,6 +153,9 @@ Release 2.0.1-alpha - UNRELEASED
HDFS-3501. Checkpointing with security enabled will stop working
after ticket lifetime expires. (atm via eli)
HDFS-3266. DFSTestUtil#waitCorruptReplicas doesn't sleep between checks.
(Madhukara Phatak via atm)
Release 2.0.0-alpha - 05-23-2012
INCOMPATIBLE CHANGES

View File

@ -323,7 +323,7 @@ public class DFSTestUtil {
*/
public static void waitCorruptReplicas(FileSystem fs, FSNamesystem ns,
Path file, ExtendedBlock b, int corruptRepls)
throws IOException, TimeoutException {
throws IOException, TimeoutException, InterruptedException {
int count = 0;
final int ATTEMPTS = 50;
int repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
@ -337,6 +337,7 @@ public class DFSTestUtil {
System.out.println("Waiting for "+corruptRepls+" corrupt replicas");
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
count++;
Thread.sleep(1000);
}
if (count == ATTEMPTS) {
throw new TimeoutException("Timed out waiting for corrupt replicas."