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:
parent
068b62b9a3
commit
3f30678f76
|
@ -153,6 +153,9 @@ Release 2.0.1-alpha - UNRELEASED
|
||||||
HDFS-3501. Checkpointing with security enabled will stop working
|
HDFS-3501. Checkpointing with security enabled will stop working
|
||||||
after ticket lifetime expires. (atm via eli)
|
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
|
Release 2.0.0-alpha - 05-23-2012
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -323,7 +323,7 @@ public class DFSTestUtil {
|
||||||
*/
|
*/
|
||||||
public static void waitCorruptReplicas(FileSystem fs, FSNamesystem ns,
|
public static void waitCorruptReplicas(FileSystem fs, FSNamesystem ns,
|
||||||
Path file, ExtendedBlock b, int corruptRepls)
|
Path file, ExtendedBlock b, int corruptRepls)
|
||||||
throws IOException, TimeoutException {
|
throws IOException, TimeoutException, InterruptedException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
final int ATTEMPTS = 50;
|
final int ATTEMPTS = 50;
|
||||||
int repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
|
int repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
|
||||||
|
@ -337,6 +337,7 @@ public class DFSTestUtil {
|
||||||
System.out.println("Waiting for "+corruptRepls+" corrupt replicas");
|
System.out.println("Waiting for "+corruptRepls+" corrupt replicas");
|
||||||
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
|
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
|
||||||
count++;
|
count++;
|
||||||
|
Thread.sleep(1000);
|
||||||
}
|
}
|
||||||
if (count == ATTEMPTS) {
|
if (count == ATTEMPTS) {
|
||||||
throw new TimeoutException("Timed out waiting for corrupt replicas."
|
throw new TimeoutException("Timed out waiting for corrupt replicas."
|
||||||
|
|
Loading…
Reference in New Issue