HBASE-10520 Add handling for swallowed InterruptedException thrown by Thread.sleep in MiniZooKeeperCluster (Feng Honghua)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1570211 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2014-02-20 14:58:25 +00:00
parent 57671618b5
commit f20938d8ec
1 changed files with 5 additions and 4 deletions

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.zookeeper;
import java.io.BufferedReader;
import java.io.File;
import java.io.InterruptedIOException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
@ -322,7 +323,7 @@ public class MiniZooKeeperCluster {
}
// XXX: From o.a.zk.t.ClientBase
private static boolean waitForServerDown(int port, long timeout) {
private static boolean waitForServerDown(int port, long timeout) throws IOException {
long start = System.currentTimeMillis();
while (true) {
try {
@ -344,14 +345,14 @@ public class MiniZooKeeperCluster {
try {
Thread.sleep(250);
} catch (InterruptedException e) {
// ignore
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
}
return false;
}
// XXX: From o.a.zk.t.ClientBase
private static boolean waitForServerUp(int port, long timeout) {
private static boolean waitForServerUp(int port, long timeout) throws IOException {
long start = System.currentTimeMillis();
while (true) {
try {
@ -385,7 +386,7 @@ public class MiniZooKeeperCluster {
try {
Thread.sleep(250);
} catch (InterruptedException e) {
// ignore
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
}
return false;