|
@@ -731,7 +731,8 @@ public class MiniDFSCluster {
|
|
|
/**
|
|
|
* wait for the cluster to get out of safemode.
|
|
|
*/
|
|
|
- public void waitClusterUp() {
|
|
|
+ public void waitClusterUp() throws IOException {
|
|
|
+ int i = 0;
|
|
|
if (numDataNodes > 0) {
|
|
|
while (!isClusterUp()) {
|
|
|
try {
|
|
@@ -739,6 +740,9 @@ public class MiniDFSCluster {
|
|
|
Thread.sleep(1000);
|
|
|
} catch (InterruptedException e) {
|
|
|
}
|
|
|
+ if (++i > 10) {
|
|
|
+ throw new IOException("Timed out waiting for Mini HDFS Cluster to start");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|