You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2015/07/17 20:53:05 UTC
[1/6] accumulo git commit: ACCUMULO-3871 add counters to know the
number of failed tests before the completion of the m/r job
Repository: accumulo
Updated Branches:
refs/heads/master e057f1a14 -> 7ec6291a3
ACCUMULO-3871 add counters to know the number of failed tests before the completion of the m/r job
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/11487511
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/11487511
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/11487511
Branch: refs/heads/master
Commit: 114875114659eed8ada0b2d881f4d126a69ec51a
Parents: e057f1a
Author: Eric C. Newton <er...@gmail.com>
Authored: Wed Jul 15 16:18:56 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Wed Jul 15 16:18:56 2015 -0400
----------------------------------------------------------------------
.../apache/accumulo/test/mrit/IntegrationTestMapReduce.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/11487511/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java b/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
index eb8a813..62b82c9 100644
--- a/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
+++ b/test/src/main/java/org/apache/accumulo/test/mrit/IntegrationTestMapReduce.java
@@ -86,6 +86,10 @@ public class IntegrationTestMapReduce extends Configured implements Tool {
static final Text PASS = new Text("PASS");
static final Text ERROR = new Text("ERROR");
+ public static enum TestCounts {
+ PASS, FAIL, ERROR
+ }
+
@Override
protected void map(LongWritable key, Text value, final Mapper<LongWritable,Text,Text,Text>.Context context) throws IOException, InterruptedException {
isMapReduce = true;
@@ -99,6 +103,7 @@ public class IntegrationTestMapReduce extends Configured implements Tool {
test = Class.forName(className);
} catch (ClassNotFoundException e) {
log.debug("Error finding class {}", className, e);
+ context.getCounter(TestCounts.ERROR);
context.write(ERROR, new Text(e.toString()));
return;
}
@@ -131,9 +136,11 @@ public class IntegrationTestMapReduce extends Configured implements Tool {
Result result = core.run(test);
if (result.wasSuccessful()) {
log.info("{} was successful", className);
+ context.getCounter(TestCounts.PASS);
context.write(PASS, value);
} else {
log.info("{} failed", className);
+ context.getCounter(TestCounts.FAIL);
context.write(FAIL, new Text(className + "(" + StringUtils.join(failures, ", ") + ")"));
}
} catch (Exception e) {
[4/6] accumulo git commit: ACCUMULO-2346 update all sleeps to a
specific time unit
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
index dcc3124..068000d 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsSplitIT.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -34,13 +35,14 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// attempt to reproduce ACCUMULO-315
public class DeleteRowsSplitIT extends AccumuloClusterHarness {
@@ -101,7 +103,7 @@ public class DeleteRowsSplitIT extends AccumuloClusterHarness {
};
t.start();
- UtilWaitThread.sleep(test * 2);
+ sleepUninterruptibly(test * 2, TimeUnit.MILLISECONDS);
conn.tableOperations().deleteRows(tableName, start, end);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
index 2251d4b..62bac85 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test.functional;
import static org.junit.Assert.fail;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.client.ClientConfiguration;
@@ -34,7 +35,6 @@ import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
import org.apache.accumulo.core.master.thrift.TableInfo;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.TestIngest;
@@ -43,6 +43,8 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class DynamicThreadPoolsIT extends AccumuloClusterHarness {
@Override
@@ -96,7 +98,7 @@ public class DynamicThreadPoolsIT extends AccumuloClusterHarness {
c.tableOperations().flush(firstTable, null, null, true);
for (int i = 1; i < tables.length; i++)
c.tableOperations().clone(firstTable, tables[i], true, null, null);
- UtilWaitThread.sleep(11 * 1000); // time between checks of the thread pool sizes
+ sleepUninterruptibly(11, TimeUnit.SECONDS); // time between checks of the thread pool sizes
Credentials creds = new Credentials(getAdminPrincipal(), getAdminToken());
for (int i = 1; i < tables.length; i++)
c.tableOperations().compact(tables[i], null, null, true, false);
@@ -119,7 +121,7 @@ public class DynamicThreadPoolsIT extends AccumuloClusterHarness {
System.out.println("count " + count);
if (count > 3)
return;
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
fail("Could not observe higher number of threads after changing the config");
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ExamplesIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ExamplesIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ExamplesIT.java
index 671a6bb..71ddbcd 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ExamplesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ExamplesIT.java
@@ -30,6 +30,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -52,7 +53,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.user.AgeOffFilter;
import org.apache.accumulo.core.iterators.user.SummingCombiner;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.client.Flush;
import org.apache.accumulo.examples.simple.client.RandomBatchScanner;
import org.apache.accumulo.examples.simple.client.RandomBatchWriter;
@@ -102,6 +102,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ExamplesIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(ExamplesIT.class);
@@ -171,7 +172,7 @@ public class ExamplesIT extends AccumuloClusterHarness {
MiniAccumuloClusterImpl impl = (MiniAccumuloClusterImpl) cluster;
trace = impl.exec(TraceServer.class);
while (!c.tableOperations().exists("trace"))
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
String[] args;
if (saslEnabled) {
@@ -286,13 +287,13 @@ public class ExamplesIT extends AccumuloClusterHarness {
is = new IteratorSetting(10, AgeOffFilter.class);
AgeOffFilter.setTTL(is, 1000L);
c.tableOperations().attachIterator(tableName, is);
- UtilWaitThread.sleep(500); // let zookeeper updates propagate.
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS); // let zookeeper updates propagate.
bw = c.createBatchWriter(tableName, bwc);
Mutation m = new Mutation("foo");
m.put("a", "b", "c");
bw.addMutation(m);
bw.close();
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
assertEquals(0, Iterators.size(c.createScanner(tableName, Authorizations.EMPTY).iterator()));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
index 6de8e93..7f11851 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
@@ -26,6 +26,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.cli.BatchWriterOpts;
@@ -46,7 +47,6 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooLock;
import org.apache.accumulo.gc.SimpleGarbageCollector;
@@ -68,6 +68,7 @@ import org.junit.Assert;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class GarbageCollectorIT extends ConfigurableMacBase {
private static final String OUR_SECRET = "itsreallysecret";
@@ -122,7 +123,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
c.tableOperations().compact("test_ingest", null, null, true, true);
int before = countFiles();
while (true) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
int more = countFiles();
if (more <= before)
break;
@@ -131,7 +132,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
// restart GC
getCluster().start();
- UtilWaitThread.sleep(15 * 1000);
+ sleepUninterruptibly(15, TimeUnit.SECONDS);
int after = countFiles();
VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
assertTrue(after < before);
@@ -146,7 +147,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
addEntries(c, new BatchWriterOpts());
cluster.getConfig().setDefaultMemory(10, MemoryUnit.MEGABYTE);
Process gc = cluster.exec(SimpleGarbageCollector.class);
- UtilWaitThread.sleep(20 * 1000);
+ sleepUninterruptibly(20, TimeUnit.SECONDS);
String output = "";
while (!output.contains("delete candidates has exceeded")) {
byte buffer[] = new byte[10 * 1024];
@@ -170,7 +171,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
c.tableOperations().create(table);
// let gc run for a bit
cluster.start();
- UtilWaitThread.sleep(20 * 1000);
+ sleepUninterruptibly(20, TimeUnit.SECONDS);
killMacGc();
// kill tservers
for (ProcessReference ref : cluster.getProcesses().get(ServerType.TABLET_SERVER)) {
@@ -218,7 +219,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
try {
String output = "";
while (!output.contains("Ingoring invalid deletion candidate")) {
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
try {
output = FunctionalTestUtils.readAll(cluster, SimpleGarbageCollector.class, gc);
} catch (IOException ioe) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
index 59d8259..f6ecf20 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
@@ -28,12 +28,12 @@ import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.ScannerOpts;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.Daemon;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.start.Main;
@@ -43,6 +43,8 @@ import org.apache.accumulo.tserver.TabletServer;
import org.apache.hadoop.conf.Configuration;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class HalfDeadTServerIT extends ConfigurableMacBase {
@Override
@@ -139,22 +141,22 @@ public class HalfDeadTServerIT extends ConfigurableMacBase {
DumpOutput t = new DumpOutput(tserver.getInputStream());
try {
t.start();
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// don't need the regular tablet server
cluster.killProcess(ServerType.TABLET_SERVER, cluster.getProcesses().get(ServerType.TABLET_SERVER).iterator().next());
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
c.tableOperations().create("test_ingest");
assertEquals(1, c.instanceOperations().getTabletServers().size());
int rows = 100 * 1000;
ingest = cluster.exec(TestIngest.class, "-u", "root", "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-p", ROOT_PASSWORD, "--rows", rows
+ "");
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
// block I/O with some side-channel trickiness
File trickFile = new File(trickFilename);
try {
assertTrue(trickFile.createNewFile());
- UtilWaitThread.sleep(seconds * 1000);
+ sleepUninterruptibly(seconds, TimeUnit.SECONDS);
} finally {
if (!trickFile.delete()) {
log.error("Couldn't delete " + trickFile);
@@ -168,7 +170,7 @@ public class HalfDeadTServerIT extends ConfigurableMacBase {
vopts.setPrincipal("root");
VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
} else {
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
tserver.waitFor();
t.join();
tserver = null;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/LargeRowIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/LargeRowIT.java b/test/src/main/java/org/apache/accumulo/test/functional/LargeRowIT.java
index 72b51eb..34d11fc 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/LargeRowIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/LargeRowIT.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -33,7 +34,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.MemoryUnit;
import org.apache.accumulo.minicluster.ServerType;
@@ -48,6 +48,8 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class LargeRowIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(LargeRowIT.class);
@@ -117,7 +119,7 @@ public class LargeRowIT extends AccumuloClusterHarness {
c.tableOperations().create(REG_TABLE_NAME);
c.tableOperations().create(PRE_SPLIT_TABLE_NAME);
c.tableOperations().setProperty(PRE_SPLIT_TABLE_NAME, Property.TABLE_MAX_END_ROW_SIZE.getKey(), "256K");
- UtilWaitThread.sleep(3 * 1000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
c.tableOperations().addSplits(PRE_SPLIT_TABLE_NAME, splitPoints);
test1(c);
test2(c);
@@ -129,7 +131,7 @@ public class LargeRowIT extends AccumuloClusterHarness {
c.tableOperations().setProperty(REG_TABLE_NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "" + SPLIT_THRESH);
- UtilWaitThread.sleep(timeoutFactor * 12000);
+ sleepUninterruptibly(timeoutFactor * 12, TimeUnit.SECONDS);
log.info("checking splits");
FunctionalTestUtils.checkSplits(c, REG_TABLE_NAME, NUM_PRE_SPLITS / 2, NUM_PRE_SPLITS * 4);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
index 9455456..aba0a24 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataIT.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.Connector;
@@ -36,7 +37,6 @@ import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -45,6 +45,7 @@ import org.junit.Assert;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class MetadataIT extends AccumuloClusterHarness {
@@ -111,7 +112,7 @@ public class MetadataIT extends AccumuloClusterHarness {
Scanner s = c.createScanner(RootTable.NAME, Authorizations.EMPTY);
s.setRange(MetadataSchema.DeletesSection.getRange());
while (Iterators.size(s.iterator()) == 0) {
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
assertEquals(0, c.tableOperations().listSplits(MetadataTable.NAME).size());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
index 977a659..3e8b421 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.impl.ClientContext;
@@ -35,7 +36,6 @@ import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.server.util.Admin;
import org.apache.hadoop.conf.Configuration;
@@ -43,6 +43,8 @@ import org.apache.hadoop.fs.RawLocalFileSystem;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class MetadataMaxFilesIT extends ConfigurableMacBase {
@Override
@@ -67,7 +69,7 @@ public class MetadataMaxFilesIT extends ConfigurableMacBase {
}
c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10000");
// propagation time
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
for (int i = 0; i < 5; i++) {
String tableName = "table" + i;
log.info("Creating " + tableName);
@@ -109,7 +111,7 @@ public class MetadataMaxFilesIT extends ConfigurableMacBase {
log.info("Online tablets " + tablets);
if (tablets == 5005)
break;
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
index ab2c791..58480bc 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MetadataSplitIT.java
@@ -20,15 +20,17 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Collections;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class MetadataSplitIT extends ConfigurableMacBase {
@Override
@@ -50,7 +52,7 @@ public class MetadataSplitIT extends ConfigurableMacBase {
c.tableOperations().create("table" + i);
c.tableOperations().flush(MetadataTable.NAME, null, null, true);
}
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
assertTrue(c.tableOperations().listSplits(MetadataTable.NAME).size() > 2);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
index 39e9bed..d73bf3e 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java
@@ -39,7 +39,6 @@ import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.metadata.MetadataTable;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooLock;
@@ -59,6 +58,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Charsets;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class RestartIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(RestartIT.class);
@@ -190,7 +190,7 @@ public class RestartIT extends AccumuloClusterHarness {
} while (null != masterLockData);
cluster.start();
- UtilWaitThread.sleep(5);
+ sleepUninterruptibly(5, TimeUnit.MILLISECONDS);
control.stopAllServers(ServerType.MASTER);
masterLockData = new byte[0];
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/RestartStressIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RestartStressIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RestartStressIT.java
index abfd5d8..f607d16 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/RestartStressIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/RestartStressIT.java
@@ -33,7 +33,6 @@ import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -48,6 +47,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Charsets;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class RestartStressIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(RestartStressIT.class);
@@ -132,7 +132,7 @@ public class RestartStressIT extends AccumuloClusterHarness {
});
for (int i = 0; i < 2; i++) {
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
control.stopAllServers(ServerType.TABLET_SERVER);
control.startAllServers(ServerType.TABLET_SERVER);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ScanIdIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanIdIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanIdIT.java
index 863ac78..7830939 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ScanIdIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanIdIT.java
@@ -33,6 +33,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.core.client.AccumuloException;
@@ -52,13 +53,14 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorUtil;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* ACCUMULO-2641 Integration test. ACCUMULO-2641 Adds scan id to thrift protocol so that {@code org.apache.accumulo.core.client.admin.ActiveScan.getScanid()}
* returns a unique scan id.
@@ -127,7 +129,7 @@ public class ScanIdIT extends AccumuloClusterHarness {
if (resultsByWorker.size() < NUM_SCANNERS) {
log.trace("Results reported {}", resultsByWorker.size());
- UtilWaitThread.sleep(750);
+ sleepUninterruptibly(750, TimeUnit.MILLISECONDS);
} else {
// each worker has reported at least one result.
testInProgress.set(false);
@@ -135,7 +137,7 @@ public class ScanIdIT extends AccumuloClusterHarness {
log.debug("Final result count {}", resultsByWorker.size());
// delay to allow scanners to react to end of test and cleanly close.
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -285,7 +287,7 @@ public class ScanIdIT extends AccumuloClusterHarness {
conn.tableOperations().offline(tableName, true);
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
conn.tableOperations().online(tableName, true);
for (Text split : conn.tableOperations().listSplits(tableName)) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ScanSessionTimeOutIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanSessionTimeOutIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanSessionTimeOutIT.java
index 0636056..78262ef 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ScanSessionTimeOutIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanSessionTimeOutIT.java
@@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -33,7 +34,6 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -44,6 +44,8 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ScanSessionTimeOutIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(ScanSessionTimeOutIT.class);
@@ -104,7 +106,7 @@ public class ScanSessionTimeOutIT extends AccumuloClusterHarness {
verify(iter, 0, 200);
// sleep three times the session timeout
- UtilWaitThread.sleep(9000);
+ sleepUninterruptibly(9, TimeUnit.SECONDS);
verify(iter, 200, 100000);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
index 02b65f4..334cf1c 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ServerSideErrorIT.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.test.functional;
import java.util.Collections;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
@@ -32,11 +33,12 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.Combiner;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ServerSideErrorIT extends AccumuloClusterHarness {
@Override
@@ -101,7 +103,7 @@ public class ServerSideErrorIT extends AccumuloClusterHarness {
to.removeProperty(tableName, e.getKey());
}
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
// should be able to scan now
scanner = c.createScanner(tableName, Authorizations.EMPTY);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
index 06399d8..9a2e42e 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ShutdownIT.java
@@ -21,10 +21,10 @@ import static org.junit.Assert.assertFalse;
import java.io.IOException;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.server.util.Admin;
import org.apache.accumulo.test.TestIngest;
@@ -32,6 +32,8 @@ import org.apache.accumulo.test.TestRandomDeletes;
import org.apache.accumulo.test.VerifyIngest;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ShutdownIT extends ConfigurableMacBase {
@Override
@@ -43,7 +45,7 @@ public class ShutdownIT extends ConfigurableMacBase {
public void shutdownDuringIngest() throws Exception {
Process ingest = cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD,
"--createTable");
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
ingest.destroy();
}
@@ -54,7 +56,7 @@ public class ShutdownIT extends ConfigurableMacBase {
cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable")
.waitFor());
Process verify = cluster.exec(VerifyIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
verify.destroy();
}
@@ -65,7 +67,7 @@ public class ShutdownIT extends ConfigurableMacBase {
cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable")
.waitFor());
Process deleter = cluster.exec(TestRandomDeletes.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
deleter.destroy();
}
@@ -89,7 +91,7 @@ public class ShutdownIT extends ConfigurableMacBase {
}
};
async.start();
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor());
if (ref.get() != null)
throw ref.get();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
index 3fcbcfb..45cf06d 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SimpleBalancerFairnessIT.java
@@ -16,12 +16,14 @@
*/
package org.apache.accumulo.test.functional;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.BatchWriterOpts;
import org.apache.accumulo.core.client.Connector;
@@ -35,7 +37,6 @@ import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
import org.apache.accumulo.core.master.thrift.TableInfo;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.MemoryUnit;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -73,7 +74,7 @@ public class SimpleBalancerFairnessIT extends ConfigurableMacBase {
opts.setPrincipal("root");
TestIngest.ingest(c, opts, new BatchWriterOpts());
c.tableOperations().flush("test_ingest", null, null, false);
- UtilWaitThread.sleep(45 * 1000);
+ sleepUninterruptibly(45, TimeUnit.SECONDS);
Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));
ClientContext context = new ClientContext(c.getInstance(), creds, getClientConfig());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/SlowConstraint.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SlowConstraint.java b/test/src/main/java/org/apache/accumulo/test/functional/SlowConstraint.java
index 187da35..3f8cc27 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SlowConstraint.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SlowConstraint.java
@@ -17,10 +17,12 @@
package org.apache.accumulo.test.functional;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.constraints.Constraint;
import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.util.UtilWaitThread;
+
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
*
@@ -34,7 +36,7 @@ public class SlowConstraint implements Constraint {
@Override
public List<Short> check(Environment env, Mutation mutation) {
- UtilWaitThread.sleep(20000);
+ sleepUninterruptibly(20, TimeUnit.SECONDS);
return null;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/SlowIterator.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SlowIterator.java b/test/src/main/java/org/apache/accumulo/test/functional/SlowIterator.java
index f84a4d9..aeb0dff 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SlowIterator.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SlowIterator.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test.functional;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.data.ByteSequence;
@@ -28,7 +29,8 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.WrappingIterator;
-import org.apache.accumulo.core.util.UtilWaitThread;
+
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class SlowIterator extends WrappingIterator {
@@ -53,13 +55,13 @@ public class SlowIterator extends WrappingIterator {
@Override
public void next() throws IOException {
- UtilWaitThread.sleep(sleepTime);
+ sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS);
super.next();
}
@Override
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
- UtilWaitThread.sleep(seekSleepTime);
+ sleepUninterruptibly(seekSleepTime, TimeUnit.MILLISECONDS);
super.seek(range, columnFamilies, inclusive);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
index 49cd2aa..11694fd 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SplitIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.cluster.ClusterUser;
import org.apache.accumulo.core.cli.BatchWriterOpts;
@@ -39,7 +40,6 @@ import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -56,6 +56,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Charsets;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class SplitIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(SplitIT.class);
@@ -146,7 +147,7 @@ public class SplitIT extends AccumuloClusterHarness {
vopts.setTableName(table);
VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
while (c.tableOperations().listSplits(table).size() < 10) {
- UtilWaitThread.sleep(15 * 1000);
+ sleepUninterruptibly(15, TimeUnit.SECONDS);
}
String id = c.tableOperations().tableIdMap().get(table);
Scanner s = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
@@ -185,9 +186,9 @@ public class SplitIT extends AccumuloClusterHarness {
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
c.tableOperations().setProperty(tableName, Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), "none");
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
ReadWriteIT.interleaveTest(c, tableName);
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
int numSplits = c.tableOperations().listSplits(tableName).size();
while (numSplits <= 20) {
log.info("Waiting for splits to happen");
@@ -213,7 +214,7 @@ public class SplitIT extends AccumuloClusterHarness {
DeleteIT.deleteTest(c, getCluster(), getAdminPrincipal(), password, tableName, keytab);
c.tableOperations().flush(tableName, null, null, true);
for (int i = 0; i < 5; i++) {
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
if (c.tableOperations().listSplits(tableName).size() > 20)
break;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/TimeoutIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/TimeoutIT.java b/test/src/main/java/org/apache/accumulo/test/functional/TimeoutIT.java
index ffadd22..d13c4af 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/TimeoutIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/TimeoutIT.java
@@ -34,10 +34,11 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
*
*/
@@ -61,7 +62,7 @@ public class TimeoutIT extends AccumuloClusterHarness {
conn.tableOperations().addConstraint(tableName, SlowConstraint.class.getName());
// give constraint time to propagate through zookeeper
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig().setTimeout(3, TimeUnit.SECONDS));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
index f1d8344..ab3c662 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
@@ -35,6 +35,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
@@ -48,7 +49,6 @@ import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.state.SetGoalState;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterControl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
@@ -64,6 +64,7 @@ import org.junit.Assert;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class WALSunnyDayIT extends ConfigurableMacBase {
@@ -117,7 +118,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase {
for (String table : new String[] {tableName, MetadataTable.NAME, RootTable.NAME}) {
c.tableOperations().flush(table, null, null, true);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// rolled WAL is no longer in use, but needs to be GC'd
Map<String,Boolean> walsAfterflush = getWals(c);
assertEquals(walsAfterflush.toString(), 3, walsAfterflush.size());
@@ -125,7 +126,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase {
// let the GC run for a little bit
control.start(GARBAGE_COLLECTOR);
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
// make sure the unused WAL goes away
Map<String,Boolean> walsAfterGC = getWals(c);
assertEquals(walsAfterGC.toString(), 2, walsAfterGC.size());
@@ -139,7 +140,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase {
// wait for the metadata table to go back online
getRecoveryMarkers(c);
// allow a little time for the master to notice ASSIGNED_TO_DEAD_SERVER tablets
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
Map<KeyExtent,List<String>> markers = getRecoveryMarkers(c);
// log.debug("markers " + markers);
assertEquals("one tablet should have markers", 1, markers.keySet().size());
@@ -154,7 +155,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase {
// log.debug("wals after " + walsAfterRestart);
assertEquals("used WALs after restart should be 4", 4, countTrue(walsAfterRestart.values()));
control.start(GARBAGE_COLLECTOR);
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
Map<String,Boolean> walsAfterRestartAndGC = getWals(c);
assertEquals("wals left should be 2", 2, walsAfterRestartAndGC.size());
assertEquals("logs in use should be 2", 2, countTrue(walsAfterRestartAndGC.values()));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
index da9f1d6..82f677b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
@@ -20,6 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.HashMap;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
@@ -32,7 +33,6 @@ import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.trace.thrift.TInfo;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
import org.apache.accumulo.fate.zookeeper.ZooLock.LockWatcher;
@@ -51,6 +51,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Tablet server that creates a lock in zookeeper, responds to one status request, and then hangs on subsequent requests. Exits with code zero if halted.
@@ -82,7 +83,7 @@ public class ZombieTServer {
return result;
}
}
- UtilWaitThread.sleep(Integer.MAX_VALUE);
+ sleepUninterruptibly(Integer.MAX_VALUE, TimeUnit.DAYS);
return null;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
index 19f90fe..b19ec2f 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
@@ -33,13 +34,14 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.minicluster.impl.ProcessReference;
import org.apache.hadoop.conf.Configuration;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ZookeeperRestartIT extends ConfigurableMacBase {
@Override
@@ -69,7 +71,7 @@ public class ZookeeperRestartIT extends ConfigurableMacBase {
cluster.killProcess(ServerType.ZOOKEEPER, proc);
// give the servers time to react
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// start zookeeper back up
cluster.start();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
index 006df21..ef05f37 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.Help;
import org.apache.accumulo.core.client.ClientConfiguration;
@@ -59,7 +60,6 @@ import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Processor;
import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
import org.apache.accumulo.core.trace.thrift.TInfo;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.AccumuloServerContext;
import org.apache.accumulo.server.client.ClientServiceHandler;
import org.apache.accumulo.server.client.HdfsZooInstance;
@@ -77,6 +77,7 @@ import org.apache.thrift.TException;
import com.beust.jcommander.Parameter;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* The purpose of this class is to server as fake tserver that is a data sink like /dev/null. NullTserver modifies the metadata location entries for a table to
@@ -278,7 +279,7 @@ public class NullTserver {
store.setLocations(assignments);
while (true) {
- UtilWaitThread.sleep(10000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
}
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
index 745326e..7f61a08 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
@@ -27,12 +27,12 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.minicluster.impl.ProcessReference;
@@ -57,6 +57,7 @@ import org.junit.Test;
import com.google.common.collect.Iterators;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ProxyDurabilityIT extends ConfigurableMacBase {
@@ -93,7 +94,7 @@ public class ProxyDurabilityIT extends ConfigurableMacBase {
int proxyPort = PortUtils.getRandomFreePort();
final TServer proxyServer = Proxy.createProxyServer(HostAndPort.fromParts("localhost", proxyPort), protocol, props).server;
while (!proxyServer.isServing())
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
Client client = new TestProxyClient("localhost", proxyPort, protocol).proxy();
Map<String,String> properties = new TreeMap<String,String>();
properties.put("password", ROOT_PASSWORD);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java b/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
index c5656d1..8c6811f 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
@@ -41,6 +41,7 @@ import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.cluster.ClusterUser;
import org.apache.accumulo.core.client.ClientConfiguration;
@@ -60,7 +61,6 @@ import org.apache.accumulo.core.iterators.user.VersioningIterator;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.ByteBufferUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
import org.apache.accumulo.harness.MiniClusterHarness;
import org.apache.accumulo.harness.SharedMiniClusterBase;
@@ -126,6 +126,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Call every method on the proxy and try to verify that it works.
@@ -227,7 +228,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
proxyPort = PortUtils.getRandomFreePort();
proxyServer = Proxy.createProxyServer(HostAndPort.fromParts(hostname, proxyPort), factory, props, clientConfig).server;
while (!proxyServer.isServing())
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
@AfterClass
@@ -934,7 +935,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
cfg = client.getSystemConfiguration(creds);
if ("500M".equals(cfg.get("table.split.threshold")))
break;
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
}
assertEquals("500M", cfg.get("table.split.threshold"));
@@ -944,7 +945,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
cfg = client.getSystemConfiguration(creds);
if (!"500M".equals(cfg.get("table.split.threshold")))
break;
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
}
assertNotEquals("500M", cfg.get("table.split.threshold"));
}
@@ -1032,7 +1033,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
if (!scans.isEmpty())
break;
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
}
t.join();
@@ -1125,7 +1126,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
if (!compactions.isEmpty())
break;
}
- UtilWaitThread.sleep(10);
+ sleepUninterruptibly(10, TimeUnit.MILLISECONDS);
}
t.join();
@@ -1366,7 +1367,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
public void testBatchWriter() throws Exception {
client.addConstraint(creds, table, NumericValueConstraint.class.getName());
// zookeeper propagation time
- UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME);
+ sleepUninterruptibly(ZOOKEEPER_PROPAGATION_TIME, TimeUnit.MILLISECONDS);
WriterOptions writerOptions = new WriterOptions();
writerOptions.setLatencyMs(10000);
@@ -1417,7 +1418,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
assertScan(new String[][] {}, table);
- UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME);
+ sleepUninterruptibly(ZOOKEEPER_PROPAGATION_TIME, TimeUnit.MILLISECONDS);
writerOptions = new WriterOptions();
writerOptions.setLatencyMs(10000);
@@ -1494,7 +1495,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
log.debug("Removing constraint from table");
client.removeConstraint(creds, table, 2);
- UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME);
+ sleepUninterruptibly(ZOOKEEPER_PROPAGATION_TIME, TimeUnit.MILLISECONDS);
constraints = client.listConstraints(creds, table);
while (constraints.containsKey(NumericValueConstraint.class.getName())) {
@@ -1826,7 +1827,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
public void testConditionalWriter() throws Exception {
log.debug("Adding constraint {} to {}", table, NumericValueConstraint.class.getName());
client.addConstraint(creds, table, NumericValueConstraint.class.getName());
- UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME);
+ sleepUninterruptibly(ZOOKEEPER_PROPAGATION_TIME, TimeUnit.MILLISECONDS);
while (!client.listConstraints(creds, table).containsKey(NumericValueConstraint.class.getName())) {
log.info("Failed to see constraint");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
index ba6389f..b5af0b7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/OfflineTable.java
@@ -19,14 +19,16 @@ package org.apache.accumulo.test.randomwalk.concurrent;
import java.util.List;
import java.util.Properties;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.test.randomwalk.Environment;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class OfflineTable extends Test {
@Override
@@ -43,7 +45,7 @@ public class OfflineTable extends Test {
try {
conn.tableOperations().offline(tableName, rand.nextBoolean());
log.debug("Offlined " + tableName);
- UtilWaitThread.sleep(rand.nextInt(200));
+ sleepUninterruptibly(rand.nextInt(200), TimeUnit.MILLISECONDS);
conn.tableOperations().online(tableName, rand.nextBoolean());
log.debug("Onlined " + tableName);
} catch (TableNotFoundException tne) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Replication.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Replication.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Replication.java
index c1b2502..9f3e0aa 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Replication.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Replication.java
@@ -35,6 +35,7 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
@@ -47,13 +48,14 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.replication.ReplicationTable;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.test.randomwalk.Environment;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
import org.apache.accumulo.tserver.replication.AccumuloReplicaSystem;
import org.apache.hadoop.io.Text;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class Replication extends Test {
final int ROWS = 1000;
@@ -84,7 +86,7 @@ public class Replication extends Test {
for (int i = 0; i < 10; i++) {
if (online)
break;
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
online = ReplicationTable.isOnline(c);
}
assertTrue("Replication table was not online", online);
@@ -105,7 +107,7 @@ public class Replication extends Test {
tOps.setProperty(sourceTable, TABLE_REPLICATION_TARGET.getKey() + instName, destID);
// zookeeper propagation wait
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
// Maybe split the tables
Random rand = new Random(System.currentTimeMillis());
@@ -148,7 +150,7 @@ public class Replication extends Test {
}
// wait a little while for replication to take place
- UtilWaitThread.sleep(30 * 1000);
+ sleepUninterruptibly(30, TimeUnit.SECONDS);
// check the data
Scanner scanner = c.createScanner(destTable, Authorizations.EMPTY);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Shutdown.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Shutdown.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Shutdown.java
index 6cc8312..eeaeea6 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Shutdown.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Shutdown.java
@@ -17,12 +17,12 @@
package org.apache.accumulo.test.randomwalk.concurrent;
import java.util.Properties;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.impl.MasterClient;
import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
import org.apache.accumulo.core.master.thrift.MasterGoalState;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.state.SetGoalState;
import org.apache.accumulo.server.AccumuloServerContext;
import org.apache.accumulo.server.client.HdfsZooInstance;
@@ -31,6 +31,8 @@ import org.apache.accumulo.test.randomwalk.Environment;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class Shutdown extends Test {
@Override
@@ -39,7 +41,7 @@ public class Shutdown extends Test {
SetGoalState.main(new String[] {MasterGoalState.CLEAN_STOP.name()});
while (!env.getConnector().instanceOperations().getTabletServers().isEmpty()) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
while (true) {
@@ -51,11 +53,11 @@ public class Shutdown extends Test {
// assume this is due to server shutdown
break;
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
log.info("servers stopped");
- UtilWaitThread.sleep(10000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StartAll.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StartAll.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StartAll.java
index 8504fd1..cfc0053 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StartAll.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StartAll.java
@@ -17,13 +17,13 @@
package org.apache.accumulo.test.randomwalk.concurrent;
import java.util.Properties;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.impl.MasterClient;
import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
import org.apache.accumulo.core.master.thrift.MasterGoalState;
import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.state.SetGoalState;
import org.apache.accumulo.server.AccumuloServerContext;
import org.apache.accumulo.server.client.HdfsZooInstance;
@@ -32,6 +32,8 @@ import org.apache.accumulo.test.randomwalk.Environment;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class StartAll extends Test {
@Override
@@ -48,7 +50,7 @@ public class StartAll extends Test {
if (!masterStats.tServerInfo.isEmpty())
break;
} catch (Exception ex) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
index 095b5f7..5f696d0 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
@@ -25,6 +25,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
@@ -36,7 +37,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.util.Base64;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.TextUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.test.randomwalk.Environment;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
@@ -48,6 +48,8 @@ import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.util.ToolRunner;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class BulkInsert extends Test {
class SeqfileBatchWriter implements BatchWriter {
@@ -157,7 +159,7 @@ public class BulkInsert extends Test {
else
log.debug("Ignoring " + failure.getPath());
}
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
} else
break;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
index b6888db..e73a650 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
@@ -45,7 +45,6 @@ import org.apache.accumulo.core.replication.ReplicationSchema.WorkSection;
import org.apache.accumulo.core.replication.ReplicationTable;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.replication.SequentialWorkAssigner;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
@@ -67,6 +66,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Replication tests which start at least two MAC instances and replicate data between them
@@ -668,7 +668,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
// Wait until we fully replicated something
boolean fullyReplicated = false;
for (int i = 0; i < 10 && !fullyReplicated; i++) {
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
Scanner s = ReplicationTable.getScanner(connMaster);
WorkSection.limit(s);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
index e0a9121..b87bf04 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/ReplicationIT.java
@@ -31,6 +31,7 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.core.Constants;
@@ -70,7 +71,6 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
@@ -106,6 +106,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import com.google.protobuf.TextFormat;
/**
@@ -296,7 +297,7 @@ public class ReplicationIT extends ConfigurableMacBase {
int attempts = 10;
do {
if (!online) {
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
online = ReplicationTable.isOnline(conn);
attempts--;
}
@@ -427,7 +428,7 @@ public class ReplicationIT extends ConfigurableMacBase {
int attempts = 10;
do {
if (!online) {
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
online = ReplicationTable.isOnline(conn);
attempts--;
}
@@ -745,7 +746,7 @@ public class ReplicationIT extends ConfigurableMacBase {
conn.tableOperations().flush(table, null, null, true);
while (!ReplicationTable.isOnline(conn)) {
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
}
for (int i = 0; i < 10; i++) {
@@ -832,7 +833,7 @@ public class ReplicationIT extends ConfigurableMacBase {
if (attempts <= 0) {
throw e;
}
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
}
}
@@ -844,7 +845,7 @@ public class ReplicationIT extends ConfigurableMacBase {
attempts = 10;
do {
if (!online) {
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
online = ReplicationTable.isOnline(conn);
attempts--;
}
@@ -853,7 +854,7 @@ public class ReplicationIT extends ConfigurableMacBase {
// ACCUMULO-2743 The Observer in the tserver has to be made aware of the change to get the combiner (made by the master)
for (int i = 0; i < 10 && !conn.tableOperations().listIterators(ReplicationTable.NAME).keySet().contains(ReplicationTable.COMBINER_NAME); i++) {
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
}
Assert.assertTrue("Combiner was never set on replication table",
@@ -992,7 +993,7 @@ public class ReplicationIT extends ConfigurableMacBase {
if (attempts <= 0) {
throw e;
}
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
}
@@ -1008,7 +1009,7 @@ public class ReplicationIT extends ConfigurableMacBase {
attempts = 5;
do {
if (!online) {
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
online = ReplicationTable.isOnline(conn);
attempts--;
}
@@ -1163,7 +1164,7 @@ public class ReplicationIT extends ConfigurableMacBase {
break;
}
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
}
if (!allClosed) {
@@ -1198,7 +1199,7 @@ public class ReplicationIT extends ConfigurableMacBase {
break;
}
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
}
if (!allClosed) {
@@ -1248,7 +1249,7 @@ public class ReplicationIT extends ConfigurableMacBase {
if (attempts <= 0) {
throw e;
}
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
}
@@ -1264,7 +1265,7 @@ public class ReplicationIT extends ConfigurableMacBase {
attempts = 10;
do {
if (!online) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
online = ReplicationTable.isOnline(conn);
attempts--;
}
@@ -1359,7 +1360,7 @@ public class ReplicationIT extends ConfigurableMacBase {
cluster.getClusterControl().start(ServerType.TABLET_SERVER);
log.info("Waiting to read tables");
- UtilWaitThread.sleep(2 * 3 * 1000);
+ sleepUninterruptibly(2 * 3, TimeUnit.SECONDS);
// Make sure we can read all the tables (recovery complete)
for (String table : new String[] {MetadataTable.NAME, table1}) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
index 88224b5..7650dd5 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
@@ -45,7 +45,6 @@ import org.apache.accumulo.core.replication.ReplicationSchema.WorkSection;
import org.apache.accumulo.core.replication.ReplicationTable;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.replication.UnorderedWorkAssigner;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
@@ -67,6 +66,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
private static final Logger log = LoggerFactory.getLogger(UnorderedWorkAssignerReplicationIT.class);
@@ -204,7 +204,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
connMaster.tableOperations().setProperty(masterTable, Property.TABLE_REPLICATION_TARGET.getKey() + peerClusterName, peerTableId);
// Wait for zookeeper updates (configuration) to propagate
- UtilWaitThread.sleep(3 * 1000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
// Write some data to table1
BatchWriter bw = connMaster.createBatchWriter(masterTable, new BatchWriterConfig());
@@ -368,7 +368,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
connMaster.tableOperations().setProperty(masterTable2, Property.TABLE_REPLICATION_TARGET.getKey() + peerClusterName, peerTableId2);
// Wait for zookeeper updates (configuration) to propogate
- UtilWaitThread.sleep(3 * 1000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
// Write some data to table1
BatchWriter bw = connMaster.createBatchWriter(masterTable1, new BatchWriterConfig());
@@ -632,7 +632,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
connMaster.tableOperations().setProperty(masterTable2, Property.TABLE_REPLICATION_TARGET.getKey() + peerClusterName, peerTableId2);
// Wait for zookeeper updates (configuration) to propagate
- UtilWaitThread.sleep(3 * 1000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
// Write some data to table1
BatchWriter bw = connMaster.createBatchWriter(masterTable1, new BatchWriterConfig());
@@ -675,7 +675,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
// Wait until we fully replicated something
boolean fullyReplicated = false;
for (int i = 0; i < 10 && !fullyReplicated; i++) {
- UtilWaitThread.sleep(timeoutFactor * 2000);
+ sleepUninterruptibly(timeoutFactor * 2, TimeUnit.SECONDS);
Scanner s = ReplicationTable.getScanner(connMaster);
WorkSection.limit(s);
[6/6] accumulo git commit: ACCUMULO-2346 update all sleeps to a
specific time unit
Posted by ec...@apache.org.
ACCUMULO-2346 update all sleeps to a specific time unit
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/7ec6291a
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/7ec6291a
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/7ec6291a
Branch: refs/heads/master
Commit: 7ec6291a31bd154a08ecd2994cee30b60317a38d
Parents: 5dbb768
Author: Eric C. Newton <er...@gmail.com>
Authored: Fri Jul 17 12:58:58 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Fri Jul 17 12:58:58 2015 -0400
----------------------------------------------------------------------
.../accumulo/core/client/IsolatedScanner.java | 5 ++--
.../core/client/impl/ConditionalWriterImpl.java | 4 +--
.../accumulo/core/client/impl/MasterClient.java | 9 +++---
.../core/client/impl/OfflineIterator.java | 8 ++++--
.../client/impl/ReplicationOperationsImpl.java | 6 ++--
.../core/client/impl/RootTabletLocator.java | 6 ++--
.../accumulo/core/client/impl/ServerClient.java | 8 ++++--
.../core/client/impl/TableOperationsImpl.java | 24 ++++++++--------
.../core/client/impl/TabletLocatorImpl.java | 6 ++--
.../accumulo/core/client/impl/Writer.java | 8 ++++--
.../core/client/mapred/AbstractInputFormat.java | 10 +++++--
.../client/mapreduce/AbstractInputFormat.java | 10 +++++--
.../accumulo/core/client/TestThrift1474.java | 5 ++--
.../impl/MiniAccumuloClusterImpl.java | 4 +--
.../org/apache/accumulo/server/Accumulo.java | 8 ++++--
.../accumulo/server/client/BulkImporter.java | 4 +--
.../accumulo/server/rpc/TServerUtils.java | 5 ++--
.../org/apache/accumulo/server/util/Halt.java | 7 +++--
.../server/util/MasterMetadataUtil.java | 8 ++++--
.../accumulo/server/util/MetadataTableUtil.java | 8 +++---
.../server/util/ReplicationTableUtil.java | 6 ++--
.../accumulo/server/util/TabletIterator.java | 9 +++---
.../accumulo/gc/SimpleGarbageCollector.java | 4 +--
.../java/org/apache/accumulo/master/Master.java | 17 ++++++------
.../master/MasterClientServiceHandler.java | 5 ++--
.../accumulo/master/TabletGroupWatcher.java | 7 +++--
.../DistributedWorkQueueWorkAssigner.java | 5 ++--
.../replication/UnorderedWorkAssigner.java | 6 ++--
.../accumulo/master/replication/WorkDriver.java | 7 +++--
.../accumulo/master/tableOps/BulkImport.java | 5 ++--
.../accumulo/master/tableOps/LoadFiles.java | 8 ++++--
.../org/apache/accumulo/monitor/Monitor.java | 11 ++++----
.../accumulo/monitor/ZooKeeperStatus.java | 5 ++--
.../org/apache/accumulo/tracer/TraceServer.java | 5 ++--
.../apache/accumulo/tserver/InMemoryMap.java | 8 ++++--
.../apache/accumulo/tserver/TabletServer.java | 12 ++++----
.../tserver/TabletServerResourceManager.java | 4 +--
.../tserver/log/TabletServerLogger.java | 4 +--
.../replication/AccumuloReplicaSystem.java | 5 ++--
.../tserver/tablet/DatafileManager.java | 8 ++++--
.../accumulo/tserver/tablet/MinorCompactor.java | 6 ++--
.../apache/accumulo/tserver/tablet/Tablet.java | 6 ++--
.../accumulo/shell/commands/TraceCommand.java | 6 ++--
.../accumulo/test/AssignmentThreadsIT.java | 7 +++--
.../test/BadDeleteMarkersCreatedIT.java | 6 ++--
.../apache/accumulo/test/BalanceFasterIT.java | 7 +++--
.../org/apache/accumulo/test/CleanWalIT.java | 5 ++--
.../accumulo/test/ConditionalWriterIT.java | 8 +++---
.../org/apache/accumulo/test/ExistingMacIT.java | 6 ++--
.../apache/accumulo/test/IMMLGBenchmark.java | 5 ++--
.../apache/accumulo/test/MetaGetsReadersIT.java | 5 ++--
.../accumulo/test/MultiTableRecoveryIT.java | 5 ++--
.../org/apache/accumulo/test/NamespacesIT.java | 16 ++++++-----
.../accumulo/test/NativeMapPerformanceTest.java | 6 ++--
.../org/apache/accumulo/test/ShellServerIT.java | 19 +++++++------
.../accumulo/test/SplitCancelsMajCIT.java | 6 ++--
.../apache/accumulo/test/SplitRecoveryIT.java | 5 ++--
.../apache/accumulo/test/TableOperationsIT.java | 5 ++--
.../accumulo/test/TabletServerGivesUpIT.java | 6 ++--
.../org/apache/accumulo/test/TotalQueuedIT.java | 6 ++--
.../test/TracerRecoversAfterOfflineTableIT.java | 9 ++++--
.../test/continuous/ContinuousBatchWalker.java | 6 ++--
.../test/continuous/ContinuousScanner.java | 5 ++--
.../test/functional/AccumuloInputFormatIT.java | 6 ++--
.../accumulo/test/functional/AddSplitIT.java | 8 ++++--
.../test/functional/BadIteratorMincIT.java | 11 ++++----
.../test/functional/BatchScanSplitIT.java | 6 ++--
.../test/functional/BatchWriterFlushIT.java | 6 ++--
.../functional/BulkSplitOptimizationIT.java | 9 ++++--
.../test/functional/CacheTestReader.java | 6 ++--
.../test/functional/CacheTestWriter.java | 6 ++--
.../accumulo/test/functional/ClassLoaderIT.java | 10 ++++---
.../accumulo/test/functional/ConcurrencyIT.java | 7 +++--
.../accumulo/test/functional/ConstraintIT.java | 10 ++++---
.../test/functional/DeleteEverythingIT.java | 5 ++--
.../test/functional/DeleteRowsSplitIT.java | 6 ++--
.../test/functional/DynamicThreadPoolsIT.java | 8 ++++--
.../accumulo/test/functional/ExamplesIT.java | 9 +++---
.../test/functional/GarbageCollectorIT.java | 13 +++++----
.../test/functional/HalfDeadTServerIT.java | 14 ++++++----
.../accumulo/test/functional/LargeRowIT.java | 8 ++++--
.../accumulo/test/functional/MetadataIT.java | 5 ++--
.../test/functional/MetadataMaxFilesIT.java | 8 ++++--
.../test/functional/MetadataSplitIT.java | 6 ++--
.../accumulo/test/functional/RestartIT.java | 4 +--
.../test/functional/RestartStressIT.java | 4 +--
.../accumulo/test/functional/ScanIdIT.java | 10 ++++---
.../test/functional/ScanSessionTimeOutIT.java | 6 ++--
.../test/functional/ServerSideErrorIT.java | 6 ++--
.../accumulo/test/functional/ShutdownIT.java | 12 ++++----
.../functional/SimpleBalancerFairnessIT.java | 5 ++--
.../test/functional/SlowConstraint.java | 6 ++--
.../accumulo/test/functional/SlowIterator.java | 8 ++++--
.../accumulo/test/functional/SplitIT.java | 11 ++++----
.../accumulo/test/functional/TimeoutIT.java | 5 ++--
.../accumulo/test/functional/WALSunnyDayIT.java | 11 ++++----
.../accumulo/test/functional/ZombieTServer.java | 5 ++--
.../test/functional/ZookeeperRestartIT.java | 6 ++--
.../test/performance/thrift/NullTserver.java | 5 ++--
.../accumulo/test/proxy/ProxyDurabilityIT.java | 5 ++--
.../accumulo/test/proxy/SimpleProxyBase.java | 21 +++++++-------
.../randomwalk/concurrent/OfflineTable.java | 6 ++--
.../test/randomwalk/concurrent/Replication.java | 10 ++++---
.../test/randomwalk/concurrent/Shutdown.java | 10 ++++---
.../test/randomwalk/concurrent/StartAll.java | 6 ++--
.../test/randomwalk/shard/BulkInsert.java | 6 ++--
.../replication/MultiInstanceReplicationIT.java | 4 +--
.../test/replication/ReplicationIT.java | 29 ++++++++++----------
.../UnorderedWorkAssignerReplicationIT.java | 10 +++----
109 files changed, 492 insertions(+), 341 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java b/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
index 2e9f1d5..0479f3b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
@@ -28,9 +28,10 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.PartialKey;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* A scanner that presents a row isolated view of an accumulo table. Rows are buffered in memory on the client side. If you think your rows may not fit into
* memory, then you can provide an alternative row buffer factory to the constructor. This would allow rows to be buffered to disk for example.
@@ -111,7 +112,7 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
}
// wait a moment before retrying
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
source = newIterator(seekRange);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 24040e6..6c6a551 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -74,7 +74,6 @@ import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.trace.thrift.TInfo;
import org.apache.accumulo.core.util.BadArgumentException;
import org.apache.accumulo.core.util.ByteBufferUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
@@ -91,6 +90,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
class ConditionalWriterImpl implements ConditionalWriter {
@@ -696,7 +696,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
if ((System.currentTimeMillis() - startTime) + sleepTime > timeout)
throw new TimedOutException(Collections.singleton(location.toString()));
- UtilWaitThread.sleep(sleepTime);
+ sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS);
sleepTime = Math.min(2 * sleepTime, MAX_SLEEP);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
index 32a71bc..73e7f10 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
@@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument;
import java.net.UnknownHostException;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -29,13 +30,13 @@ import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
import org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException;
import org.apache.accumulo.core.master.thrift.MasterClientService;
import org.apache.accumulo.core.rpc.ThriftUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.thrift.TServiceClient;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class MasterClient {
private static final Logger log = LoggerFactory.getLogger(MasterClient.class);
@@ -46,7 +47,7 @@ public class MasterClient {
MasterClientService.Client result = getConnection(context);
if (result != null)
return result;
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
}
}
@@ -97,7 +98,7 @@ public class MasterClient {
return exec.execute(client);
} catch (TTransportException tte) {
log.debug("MasterClient request failed, retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} catch (ThriftSecurityException e) {
throw new AccumuloSecurityException(e.user, e.code, e);
} catch (AccumuloException e) {
@@ -130,7 +131,7 @@ public class MasterClient {
break;
} catch (TTransportException tte) {
log.debug("MasterClient request failed, retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} catch (ThriftSecurityException e) {
throw new AccumuloSecurityException(e.user, e.code, e);
} catch (AccumuloException e) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
index 69ad41e..793b044 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineIterator.java
@@ -23,6 +23,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -45,8 +46,8 @@ import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileSKVIterator;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.IteratorUtil;
-import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
+import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator;
import org.apache.accumulo.core.iterators.system.ColumnQualifierFilter;
import org.apache.accumulo.core.iterators.system.DeletingIterator;
@@ -61,13 +62,14 @@ import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.LocalityGroupUtil;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.volume.VolumeConfiguration;
import org.apache.commons.lang.NotImplementedException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.io.Text;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
class OfflineIterator implements Iterator<Entry<Key,Value>> {
static class OfflineIteratorEnvironment implements IteratorEnvironment {
@@ -219,7 +221,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
}
}
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
eloc = getTabletFiles(nextRange, relFiles);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
index 009479e..5aed623 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationOperationsImpl.java
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -45,12 +46,13 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.trace.thrift.TInfo;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ReplicationOperationsImpl implements ReplicationOperations {
private static final Logger log = LoggerFactory.getLogger(ReplicationOperationsImpl.class);
@@ -127,7 +129,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
while (null == strTableId) {
strTableId = tops.tableIdMap().get(tableName);
if (null == strTableId) {
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
index 3a0c0d7..0992517 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -32,7 +33,6 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.util.OpTimer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
@@ -40,6 +40,8 @@ import org.apache.hadoop.io.Text;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class RootTabletLocator extends TabletLocator {
private final TabletServerLockChecker lockChecker;
@@ -126,7 +128,7 @@ public class RootTabletLocator extends TabletLocator {
TabletLocation location = getRootTabletLocation(context);
// Always retry when finding the root tablet
while (retry && location == null) {
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
location = getRootTabletLocation(context);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
index 9ceb880..680d23a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
@@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -32,7 +33,6 @@ import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
@@ -41,6 +41,8 @@ import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ServerClient {
private static final Logger log = LoggerFactory.getLogger(ServerClient.class);
@@ -79,7 +81,7 @@ public class ServerClient {
return exec.execute(client);
} catch (TTransportException tte) {
log.debug("ClientService request failed " + server + ", retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
if (client != null)
ServerClient.close(client);
@@ -99,7 +101,7 @@ public class ServerClient {
break;
} catch (TTransportException tte) {
log.debug("ClientService request failed " + server + ", retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
if (client != null)
ServerClient.close(client);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 6f9ea29..e6aecf2 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -104,7 +104,6 @@ import org.apache.accumulo.core.util.NamingThreadFactory;
import org.apache.accumulo.core.util.OpTimer;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.TextUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.volume.VolumeConfiguration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
@@ -118,6 +117,7 @@ import org.apache.thrift.transport.TTransportException;
import com.google.common.base.Joiner;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class TableOperationsImpl extends TableOperationsHelper {
@@ -200,7 +200,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
return client.beginFateOperation(Tracer.traceInfo(), context.rpcCreds());
} catch (TTransportException tte) {
log.debug("Failed to call beginFateOperation(), retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -218,7 +218,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
break;
} catch (TTransportException tte) {
log.debug("Failed to call executeFateOperation(), retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -233,7 +233,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
return client.waitForFateOperation(Tracer.traceInfo(), context.rpcCreds(), opid);
} catch (TTransportException tte) {
log.debug("Failed to call waitForFateOperation(), retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -249,7 +249,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
break;
} catch (TTransportException tte) {
log.debug("Failed to call finishFateOperation(), retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -420,7 +420,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
while (!successful) {
if (attempt > 0)
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
attempt++;
@@ -543,7 +543,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
}
log.info(e.getMessage() + " ... retrying ...");
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
}
}
@@ -769,7 +769,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
break;
} catch (TTransportException tte) {
log.debug("Failed to call initiateFlush, retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -784,7 +784,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
break;
} catch (TTransportException tte) {
log.debug("Failed to call initiateFlush, retrying ... ", tte);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
MasterClient.close(client);
}
@@ -957,7 +957,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
log.warn("Unable to locate bins for specified range. Retrying.");
// sleep randomly between 100 and 200ms
- UtilWaitThread.sleep(100 + random.nextInt(100));
+ sleepUninterruptibly(100 + random.nextInt(100), TimeUnit.MILLISECONDS);
binnedRanges.clear();
tl.invalidateCache();
}
@@ -1156,7 +1156,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
waitTime = Math.min(5000, waitTime);
log.trace("Waiting for " + waitFor + "(" + maxPerServer + ") tablets, startRow = " + startRow + " lastRow = " + lastRow + ", holes=" + holes
+ " sleeping:" + waitTime + "ms");
- UtilWaitThread.sleep(waitTime);
+ sleepUninterruptibly(waitTime, TimeUnit.MILLISECONDS);
} else {
break;
}
@@ -1273,7 +1273,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
} else {
log.debug("Disk usage request failed " + pair.getFirst() + ", retrying ... ", e);
}
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} catch (TException e) {
// may be a TApplicationException which indicates error on the server side
throw new AccumuloException(e);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
index c28320d..b2db827 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
@@ -30,6 +30,7 @@ import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -45,12 +46,13 @@ import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.util.OpTimer;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.TextUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class TabletLocatorImpl extends TabletLocator {
private static final Logger log = Logger.getLogger(TabletLocatorImpl.class);
@@ -439,7 +441,7 @@ public class TabletLocatorImpl extends TabletLocator {
TabletLocation tl = _locateTablet(context, row, skipRow, retry, true, lcSession);
if (retry && tl == null) {
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
if (log.isTraceEnabled())
log.trace("Failed to locate tablet containing row " + TextUtil.truncate(row) + " in table " + tableId + ", will retry...");
continue;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
index cf2d642..b8ce516 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
@@ -19,6 +19,8 @@ package org.apache.accumulo.core.client.impl;
import static com.google.common.base.Preconditions.checkArgument;
import static java.nio.charset.StandardCharsets.UTF_8;
+import java.util.concurrent.TimeUnit;
+
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.TableNotFoundException;
@@ -32,7 +34,6 @@ import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
import org.apache.accumulo.core.tabletserver.thrift.TDurability;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
import org.apache.accumulo.core.trace.Tracer;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import org.apache.thrift.TException;
import org.apache.thrift.TServiceClient;
@@ -40,6 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class Writer {
@@ -89,7 +91,7 @@ public class Writer {
if (tabLoc == null) {
log.trace("No tablet location found for row " + new String(m.getRow(), UTF_8));
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
continue;
}
@@ -110,7 +112,7 @@ public class Writer {
TabletLocator.getLocator(context, table).invalidateCache(tabLoc.tablet_extent);
}
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index 86a7adf..2a25dd5 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -26,6 +26,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -68,7 +69,6 @@ import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.InputFormat;
import org.apache.hadoop.mapred.InputSplit;
@@ -78,6 +78,8 @@ import org.apache.hadoop.security.token.Token;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* An abstract input format to provide shared methods common to all other input format classes. At the very least, any classes inheriting from this class will
* need to define their own {@link RecordReader}.
@@ -667,7 +669,8 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
binnedRanges = binOfflineTable(job, tableId, ranges);
while (binnedRanges == null) {
// Some tablets were still online, try again
- UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
+ // sleep randomly between 100 and 200 ms
+ sleepUninterruptibly(100 + random.nextInt(100), TimeUnit.MILLISECONDS);
binnedRanges = binOfflineTable(job, tableId, ranges);
}
} else {
@@ -686,7 +689,8 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
}
binnedRanges.clear();
log.warn("Unable to locate bins for specified ranges. Retrying.");
- UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
+ // sleep randomly between 100 and 200 ms
+ sleepUninterruptibly(100 + random.nextInt(100), TimeUnit.MILLISECONDS);
tl.invalidateCache();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 2575fe5..76f3f20 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -26,6 +26,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -67,7 +68,6 @@ import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputFormat;
@@ -80,6 +80,8 @@ import org.apache.hadoop.security.token.Token;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* An abstract input format to provide shared methods common to all other input format classes. At the very least, any classes inheriting from this class will
* need to define their own {@link RecordReader}.
@@ -714,7 +716,8 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
binnedRanges = binOfflineTable(context, tableId, ranges);
while (binnedRanges == null) {
// Some tablets were still online, try again
- UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
+ // sleep randomly between 100 and 200 ms
+ sleepUninterruptibly(100 + random.nextInt(100), TimeUnit.MILLISECONDS);
binnedRanges = binOfflineTable(context, tableId, ranges);
}
@@ -734,7 +737,8 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
}
binnedRanges.clear();
log.warn("Unable to locate bins for specified ranges. Retrying.");
- UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
+ // sleep randomly between 100 and 200 ms
+ sleepUninterruptibly(100 + random.nextInt(100), TimeUnit.MILLISECONDS);
tl.invalidateCache();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java b/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
index a99f415..845439e 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
@@ -25,7 +25,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
import org.apache.accumulo.core.client.impl.thrift.ThriftTest;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
@@ -36,6 +35,8 @@ import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class TestThrift1474 {
static class TestServer implements ThriftTest.Iface {
@@ -77,7 +78,7 @@ public class TestThrift1474 {
};
thread.start();
while (!server.isServing()) {
- UtilWaitThread.sleep(10);
+ sleepUninterruptibly(10, TimeUnit.MILLISECONDS);
}
TTransport transport = new TSocket("localhost", port);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index 4c3d6f6..0cb14c7 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -75,7 +75,6 @@ import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.master.state.SetGoalState;
@@ -111,6 +110,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import com.google.common.collect.Maps;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* A utility class that will create Zookeeper and Accumulo processes that write all of their data to a single local directory. This class makes it easy to test
@@ -621,7 +621,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
ret = exec(Main.class, SetGoalState.class.getName(), MasterGoalState.NORMAL.toString()).waitFor();
if (ret == 0)
break;
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
if (ret != 0) {
throw new RuntimeException("Could not set master goal state, process returned " + ret + ". Check the logs in " + config.getLogDir() + " for errors.");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
index c888be5..f55199f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
@@ -27,6 +27,7 @@ import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Map.Entry;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -34,7 +35,6 @@ import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.AddressUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.util.Version;
import org.apache.accumulo.core.volume.Volume;
import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -55,6 +55,8 @@ import org.apache.log4j.Logger;
import org.apache.log4j.helpers.LogLog;
import org.apache.zookeeper.KeeperException;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class Accumulo {
private static final Logger log = Logger.getLogger(Accumulo.class);
@@ -261,7 +263,7 @@ public class Accumulo {
// ignored
} catch (KeeperException ex) {
log.info("Waiting for accumulo to be initialized");
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
log.info("ZooKeeper connected and initialized, attempting to talk to HDFS");
@@ -291,7 +293,7 @@ public class Accumulo {
}
}
log.info("Backing off due to failure; current sleep period is " + sleep / 1000. + " seconds");
- UtilWaitThread.sleep(sleep);
+ sleepUninterruptibly(sleep, TimeUnit.MILLISECONDS);
/* Back off to give transient failures more time to clear. */
sleep = Math.min(60 * 1000, sleep * 2);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
index 283d304..6e0583e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
@@ -58,7 +58,6 @@ import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.NamingThreadFactory;
import org.apache.accumulo.core.util.StopWatch;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.accumulo.server.fs.VolumeManagerImpl;
@@ -73,6 +72,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class BulkImporter {
@@ -187,7 +187,7 @@ public class BulkImporter {
// same key range and are contiguous (no holes, no overlap)
timer.start(Timers.SLEEP);
- UtilWaitThread.sleep(sleepTime);
+ sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS);
timer.stop(Timers.SLEEP);
log.debug("Trying to assign " + assignmentFailures.size() + " map files that previously failed on some key extents");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
index aaccc34..eb8095f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
@@ -29,6 +29,7 @@ import java.util.Random;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLServerSocket;
@@ -39,7 +40,6 @@ import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.UGIAssumingTransportFactory;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.server.AccumuloServerContext;
import org.apache.accumulo.server.util.Halt;
@@ -62,6 +62,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Factory methods for creating Thrift server objects
@@ -157,7 +158,7 @@ public class TServerUtils {
// TTransportException, and with a TSocket created by TSSLTransportFactory, it
// comes through as caused by a BindException.
log.info("Unable to use port {}, retrying. (Thread Name = {})", port, threadName);
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
} else {
// thrift is passing up a nested exception that isn't a BindException,
// so no reason to believe retrying on a different port would help.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/util/Halt.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Halt.java b/server/base/src/main/java/org/apache/accumulo/server/util/Halt.java
index 7f57687..cbd8510 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/Halt.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/Halt.java
@@ -16,11 +16,14 @@
*/
package org.apache.accumulo.server.util;
+import java.util.concurrent.TimeUnit;
+
import org.apache.accumulo.core.util.Daemon;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class Halt {
static private final Logger log = LoggerFactory.getLogger(Halt.class);
@@ -49,7 +52,7 @@ public class Halt {
new Daemon() {
@Override
public void run() {
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
Runtime.getRuntime().halt(status);
}
}.start();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
index bac70b2..5d84ee4 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
@@ -28,6 +28,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.Scanner;
@@ -47,7 +48,6 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Lo
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ScanFileColumnFamily;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.ColumnFQ;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
import org.apache.accumulo.server.fs.FileRef;
@@ -61,6 +61,8 @@ import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
*
*/
@@ -196,7 +198,7 @@ public class MasterMetadataUtil {
} catch (InterruptedException e) {
log.error("{}", e.getMessage(), e);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -279,7 +281,7 @@ public class MasterMetadataUtil {
} catch (InterruptedException e) {
log.error("{}", e.getMessage(), e);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 4a85a88..bcfbbc8 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -74,7 +74,6 @@ import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException
import org.apache.accumulo.core.util.ColumnFQ;
import org.apache.accumulo.core.util.FastFormat;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
@@ -96,6 +95,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Optional;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* provides a reference to the metadata table for updates by tablet servers
@@ -162,7 +162,7 @@ public class MetadataTableUtil {
} catch (TableNotFoundException e) {
log.error("{}", e.getMessage(), e);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -262,7 +262,7 @@ public class MetadataTableUtil {
} catch (Exception e) {
log.error("Unexpected exception {}", e.getMessage(), e);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -854,7 +854,7 @@ public class MetadataTableUtil {
log.debug("Tablets merged in table " + srcTableId + " while attempting to clone, trying again");
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
index c6d5ce4..b57affe 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/ReplicationTableUtil.java
@@ -21,6 +21,7 @@ import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -43,7 +44,6 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.ReplicationSection;
import org.apache.accumulo.core.protobuf.ProtobufUtil;
import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.replication.StatusCombiner;
import org.apache.accumulo.server.replication.StatusFormatter;
import org.apache.accumulo.server.replication.proto.Replication.Status;
@@ -52,6 +52,8 @@ import org.apache.hadoop.io.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* provides a reference to the replication table for updates by tablet servers
*/
@@ -168,7 +170,7 @@ public class ReplicationTableUtil {
} catch (TableNotFoundException e) {
log.error(e.toString(), e);
}
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
index 2137999..d6864c1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/TabletIterator.java
@@ -23,6 +23,7 @@ import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
@@ -32,12 +33,12 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* This class iterates over the metadata table returning all key values for a tablet in one chunk. As it scans the metadata table it checks the correctness of
@@ -126,7 +127,7 @@ public class TabletIterator implements Iterator<Map<Key,Value>> {
currentTabletKeys = null;
resetScanner();
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
continue;
}
@@ -141,7 +142,7 @@ public class TabletIterator implements Iterator<Map<Key,Value>> {
currentTabletKeys = null;
resetScanner();
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
continue;
@@ -218,7 +219,7 @@ public class TabletIterator implements Iterator<Map<Key,Value>> {
resetScanner();
curMetaDataRow = null;
tm.clear();
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
} else {
break;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 4f64c15..2c894f8 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -73,7 +73,6 @@ import org.apache.accumulo.core.util.NamingThreadFactory;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.volume.Volume;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
@@ -111,6 +110,7 @@ import com.google.common.base.Function;
import com.google.common.collect.Iterators;
import com.google.common.collect.Maps;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import com.google.protobuf.InvalidProtocolBufferException;
public class SimpleGarbageCollector extends AccumuloServerContext implements Iface {
@@ -705,7 +705,7 @@ public class SimpleGarbageCollector extends AccumuloServerContext implements Ifa
return;
}
log.debug("Failed to get GC ZooKeeper lock, will retry");
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index c698b45..6f8bc55 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -32,6 +32,7 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -73,7 +74,6 @@ import org.apache.accumulo.core.trace.DistributedTrace;
import org.apache.accumulo.core.trace.thrift.TInfo;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.AgeOffStore;
import org.apache.accumulo.fate.Fate;
@@ -158,6 +158,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* The Master is responsible for assigning and balancing tablets to tablet servers.
@@ -697,7 +698,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
return MasterGoalState.valueOf(new String(data));
} catch (Exception e) {
log.error("Problem getting real goal state from zookeeper: " + e);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -827,7 +828,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
log.error("Error cleaning up migrations", ex);
}
}
- UtilWaitThread.sleep(TIME_BETWEEN_MIGRATION_CLEANUPS);
+ sleepUninterruptibly(TIME_BETWEEN_MIGRATION_CLEANUPS, TimeUnit.MILLISECONDS);
}
}
@@ -965,7 +966,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
eventListener.waitForEvents(wait);
} catch (Throwable t) {
log.error("Error balancing tablets, will wait for " + WAIT_BETWEEN_ERRORS / ONE_SECOND + " (seconds) and then retry", t);
- UtilWaitThread.sleep(WAIT_BETWEEN_ERRORS);
+ sleepUninterruptibly(WAIT_BETWEEN_ERRORS, TimeUnit.MILLISECONDS);
}
}
}
@@ -1167,7 +1168,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
log.info("Waiting for AuthenticationTokenKeyManager to be initialized");
logged = true;
}
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
}
// And log when we are initialized
log.info("AuthenticationTokenSecretManager is initialized");
@@ -1190,7 +1191,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
masterLock.replaceLockData(address.getBytes());
while (!clientService.isServing()) {
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
// Start the daemon to scan the replication table and make units of work
@@ -1229,7 +1230,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
}
while (clientService.isServing()) {
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
log.info("Shutting down fate.");
fate.shutdown();
@@ -1345,7 +1346,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
masterLock.tryToCancelAsyncLockOrUnlock();
- UtilWaitThread.sleep(TIME_TO_WAIT_BETWEEN_LOCK_CHECKS);
+ sleepUninterruptibly(TIME_TO_WAIT_BETWEEN_LOCK_CHECKS, TimeUnit.MILLISECONDS);
}
setMasterState(MasterState.HAVE_LOCK);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
index 0cb1272..7f23ad5 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -71,7 +72,6 @@ import org.apache.accumulo.core.security.thrift.TDelegationToken;
import org.apache.accumulo.core.security.thrift.TDelegationTokenConfig;
import org.apache.accumulo.core.trace.thrift.TInfo;
import org.apache.accumulo.core.util.ByteBufferUtil;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter.Mutator;
import org.apache.accumulo.master.tableOps.TraceRepo;
@@ -96,6 +96,7 @@ import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.slf4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import com.google.protobuf.InvalidProtocolBufferException;
class MasterClientServiceHandler extends FateServiceHandler implements MasterClientService.Iface {
@@ -161,7 +162,7 @@ class MasterClientServiceHandler extends FateServiceHandler implements MasterCli
if (l == maxLoops - 1)
break;
- UtilWaitThread.sleep(50);
+ sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
serversToFlush.clear();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
index d2cbf62..d1272e8 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/TabletGroupWatcher.java
@@ -30,6 +30,7 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
@@ -60,7 +61,6 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.Fu
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
import org.apache.accumulo.core.util.Daemon;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.Master.TabletGoalState;
import org.apache.accumulo.master.state.MergeStats;
import org.apache.accumulo.master.state.TableCounts;
@@ -91,6 +91,7 @@ import org.apache.thrift.TException;
import com.google.common.base.Optional;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
class TabletGroupWatcher extends Daemon {
// Constants used to make sure assignment logging isn't excessive in quantity or size
@@ -134,7 +135,7 @@ class TabletGroupWatcher extends Daemon {
while (this.master.stillMaster()) {
// slow things down a little, otherwise we spam the logs when there are many wake-up events
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
masterState = master.getMasterState();
int totalUnloaded = 0;
@@ -336,7 +337,7 @@ class TabletGroupWatcher extends Daemon {
if (ex.getCause() != null && ex.getCause() instanceof BadLocationStateException) {
repairMetadata(((BadLocationStateException) ex.getCause()).getEncodedEndRow());
} else {
- UtilWaitThread.sleep(Master.WAIT_BETWEEN_ERRORS);
+ sleepUninterruptibly(Master.WAIT_BETWEEN_ERRORS, TimeUnit.MILLISECONDS);
}
} finally {
if (iter != null) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
index 4e3a079..a10c90d 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/DistributedWorkQueueWorkAssigner.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.master.replication;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
@@ -34,7 +35,6 @@ import org.apache.accumulo.core.replication.ReplicationSchema.WorkSection;
import org.apache.accumulo.core.replication.ReplicationTable;
import org.apache.accumulo.core.replication.ReplicationTableOfflineException;
import org.apache.accumulo.core.replication.ReplicationTarget;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.server.replication.DistributedWorkQueueWorkAssignerHelper;
import org.apache.accumulo.server.replication.StatusUtil;
@@ -47,6 +47,7 @@ import org.apache.hadoop.io.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import com.google.protobuf.InvalidProtocolBufferException;
/**
@@ -178,7 +179,7 @@ public abstract class DistributedWorkQueueWorkAssigner implements WorkAssigner {
workScanner = ReplicationTable.getScanner(conn);
} catch (ReplicationTableOfflineException e) {
log.warn("Replication table is offline. Will retry...");
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
return;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
index 9a28dd4..ab5b041 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/UnorderedWorkAssigner.java
@@ -19,12 +19,12 @@ package org.apache.accumulo.master.replication;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.replication.ReplicationConstants;
import org.apache.accumulo.core.replication.ReplicationTarget;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.server.replication.DistributedWorkQueueWorkAssignerHelper;
import org.apache.hadoop.fs.Path;
@@ -32,6 +32,8 @@ import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* Read work records from the replication table, create work entries for other nodes to complete.
* <p>
@@ -84,7 +86,7 @@ public class UnorderedWorkAssigner extends DistributedWorkQueueWorkAssigner {
} catch (KeeperException e) {
if (KeeperException.Code.NONODE.equals(e.code())) {
log.warn("Could not find ZK root for replication work queue, will retry", e);
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
continue;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
index 3558d2d..f0c368a 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/replication/WorkDriver.java
@@ -16,18 +16,21 @@
*/
package org.apache.accumulo.master.replication;
+import java.util.concurrent.TimeUnit;
+
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.Daemon;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.master.Master;
import org.apache.accumulo.server.replication.WorkAssigner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* Driver for a {@link WorkAssigner}
*/
@@ -103,7 +106,7 @@ public class WorkDriver extends Daemon {
long sleepTime = conf.getTimeInMillis(Property.REPLICATION_WORK_ASSIGNMENT_SLEEP);
log.debug("Sleeping {} ms before next work assignment", sleepTime);
- UtilWaitThread.sleep(sleepTime);
+ sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS);
// After each loop, make sure that the WorkAssigner implementation didn't change
configureWorkAssigner();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
index eb19706..5313964 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
@@ -33,7 +33,6 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.Repo;
import org.apache.accumulo.master.Master;
import org.apache.accumulo.server.ServerConstants;
@@ -47,6 +46,8 @@ import org.apache.hadoop.io.MapFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/*
* Bulk import makes requests of tablet servers, and those requests can take a
* long time. Our communications to the tablet server may fail, so we won't know
@@ -170,7 +171,7 @@ public class BulkImport extends MasterRepo {
return newBulkDir;
log.warn("Failed to create " + newBulkDir + " for unknown reason");
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
index 9e72eab..0c0aad6 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/LoadFiles.java
@@ -30,6 +30,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.impl.AcceptableThriftTableOperationException;
import org.apache.accumulo.core.client.impl.ServerClient;
@@ -42,7 +43,6 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.trace.Tracer;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.Repo;
import org.apache.accumulo.master.Master;
import org.apache.accumulo.server.fs.VolumeManager;
@@ -53,6 +53,8 @@ import org.apache.htrace.wrappers.TraceExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
class LoadFiles extends MasterRepo {
private static final long serialVersionUID = 1L;
@@ -124,7 +126,7 @@ class LoadFiles extends MasterRepo {
log.warn("There are no tablet server to process bulk import, waiting (tid = " + tid + ")");
while (master.onlineTabletServers().size() == 0) {
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
// Use the threadpool to assign files one-at-a-time to the server
@@ -167,7 +169,7 @@ class LoadFiles extends MasterRepo {
filesToLoad.removeAll(loaded);
if (filesToLoad.size() > 0) {
log.debug("tid " + tid + " attempt " + (attempt + 1) + " " + sampleList(filesToLoad, 10) + " failed");
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 6e00863..9e44e70 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TimerTask;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
@@ -54,7 +55,6 @@ import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.fate.zookeeper.ZooLock.LockLossReason;
@@ -98,6 +98,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Serve master statistics with an embedded web server.
@@ -289,7 +290,7 @@ public class Monitor {
}
}
if (mmi == null)
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
if (mmi != null) {
int majorCompactions = 0;
@@ -511,7 +512,7 @@ public class Monitor {
log.warn("{}", e.getMessage(), e);
}
- UtilWaitThread.sleep(333);
+ sleepUninterruptibly(333, TimeUnit.MILLISECONDS);
}
}
@@ -526,7 +527,7 @@ public class Monitor {
} catch (Exception e) {
log.warn("{}", e.getMessage(), e);
}
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
}
}
}), "Scan scanner").start();
@@ -637,7 +638,7 @@ public class Monitor {
monitorLock.tryToCancelAsyncLockOrUnlock();
- UtilWaitThread.sleep(getContext().getConfiguration().getTimeInMillis(Property.MONITOR_LOCK_CHECK_INTERVAL));
+ sleepUninterruptibly(getContext().getConfiguration().getTimeInMillis(Property.MONITOR_LOCK_CHECK_INTERVAL), TimeUnit.MILLISECONDS);
}
log.info("Got Monitor lock.");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/monitor/src/main/java/org/apache/accumulo/monitor/ZooKeeperStatus.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/ZooKeeperStatus.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/ZooKeeperStatus.java
index 2e89344..7e992e0 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/ZooKeeperStatus.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/ZooKeeperStatus.java
@@ -22,17 +22,18 @@ import java.util.Collection;
import java.util.Objects;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.core.rpc.TTimeoutTransport;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ZooKeeperStatus implements Runnable {
@@ -142,7 +143,7 @@ public class ZooKeeperStatus implements Runnable {
}
}
status = update;
- UtilWaitThread.sleep(5 * 1000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
----------------------------------------------------------------------
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
index 7511f3c..d200e7b 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@ -42,7 +42,6 @@ import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.user.AgeOffFilter;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
import org.apache.accumulo.server.Accumulo;
@@ -77,6 +76,8 @@ import org.apache.zookeeper.Watcher.Event.KeeperState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class TraceServer implements Watcher {
final private static Logger log = LoggerFactory.getLogger(TraceServer.class);
@@ -220,7 +221,7 @@ public class TraceServer implements Watcher {
break;
} catch (RuntimeException ex) {
log.info("Waiting to checking/create the trace table.", ex);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
this.connector = connector;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
index 2d3a0a1..2274eea 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
@@ -29,6 +29,7 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListMap;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -60,7 +61,6 @@ import org.apache.accumulo.core.util.LocalityGroupUtil;
import org.apache.accumulo.core.util.LocalityGroupUtil.LocalityGroupConfigurationError;
import org.apache.accumulo.core.util.LocalityGroupUtil.Partitioner;
import org.apache.accumulo.core.util.PreAllocatedArray;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.commons.lang.mutable.MutableLong;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
@@ -68,6 +68,8 @@ import org.apache.hadoop.fs.Path;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class InMemoryMap {
private SimpleMap map = null;
@@ -599,7 +601,7 @@ public class InMemoryMap {
long t1 = System.currentTimeMillis();
while (activeIters.size() > 0 && System.currentTimeMillis() - t1 < waitTime) {
- UtilWaitThread.sleep(50);
+ sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
}
if (activeIters.size() > 0) {
@@ -651,7 +653,7 @@ public class InMemoryMap {
log.error("Failed to create mem dump file ", ioe);
while (activeIters.size() > 0) {
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
}
[5/6] accumulo git commit: ACCUMULO-2346 update all sleeps to a
specific time unit
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 5d3e0f0..9563254 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -138,7 +138,6 @@ import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.ServerServices;
import org.apache.accumulo.core.util.ServerServices.Service;
import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
@@ -251,6 +250,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class TabletServer extends AccumuloServerContext implements Runnable {
private static final Logger log = LoggerFactory.getLogger(TabletServer.class);
@@ -528,7 +528,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
else if (e.getCause() instanceof TooManyFilesException)
throw new org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException(scanSession.extent.toThrift());
else if (e.getCause() instanceof IOException) {
- UtilWaitThread.sleep(MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS);
+ sleepUninterruptibly(MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS, TimeUnit.MILLISECONDS);
List<KVEntry> empty = Collections.emptyList();
bresult = new ScanBatch(empty, true);
scanSession.nextBatchTask = null;
@@ -1805,7 +1805,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
public void run() {
while (!majorCompactorDisabled) {
try {
- UtilWaitThread.sleep(getConfiguration().getTimeInMillis(Property.TSERV_MAJC_DELAY));
+ sleepUninterruptibly(getConfiguration().getTimeInMillis(Property.TSERV_MAJC_DELAY), TimeUnit.MILLISECONDS);
TreeMap<KeyExtent,Tablet> copyOnlineTablets = new TreeMap<KeyExtent,Tablet>();
@@ -1866,7 +1866,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
}
} catch (Throwable t) {
log.error("Unexpected exception in " + Thread.currentThread().getName(), t);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
}
@@ -2356,7 +2356,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
return;
}
log.info("Waiting for tablet server lock");
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
}
String msg = "Too many retries, exiting.";
log.info(msg);
@@ -2508,7 +2508,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
}
returnMasterConnection(iface);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
} catch (InterruptedException e) {
log.info("Interrupt Exception received, shutting down");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 65cbdf1..f42d4a4 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -42,7 +42,6 @@ import org.apache.accumulo.core.file.blockfile.cache.LruBlockCache;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.NamingThreadFactory;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.server.conf.ServerConfigurationFactory;
import org.apache.accumulo.server.fs.FileRef;
@@ -64,6 +63,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.annotations.VisibleForTesting;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* ResourceManager is responsible for managing the resources of all tablets within a tablet server.
@@ -448,7 +448,7 @@ public class TabletServerResourceManager {
log.error("Minor compactions for memory managment failed", t);
}
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index 304b8c3..e6d7185 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@ -40,7 +40,6 @@ import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.protobuf.ProtobufUtil;
import org.apache.accumulo.core.replication.ReplicationConfigurationUtil;
import org.apache.accumulo.core.util.SimpleThreadPool;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.util.LoggingRunnable;
import org.apache.accumulo.server.conf.TableConfiguration;
import org.apache.accumulo.server.fs.VolumeManager;
@@ -60,6 +59,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
* Central logging facility for the TServerInfo.
@@ -386,7 +386,7 @@ public class TabletServerLogger {
if (attempt != 1) {
log.error("Unexpected error writing to log, retrying attempt " + attempt, t);
}
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
} finally {
attempt++;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index e8e9627..417a107 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -29,6 +29,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.client.AccumuloException;
@@ -58,7 +59,6 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.core.trace.ProbabilitySampler;
import org.apache.accumulo.core.trace.Span;
import org.apache.accumulo.core.trace.Trace;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.client.HdfsZooInstance;
import org.apache.accumulo.server.conf.ServerConfigurationFactory;
import org.apache.accumulo.server.fs.VolumeManager;
@@ -81,6 +81,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class AccumuloReplicaSystem implements ReplicaSystem {
private static final Logger log = LoggerFactory.getLogger(AccumuloReplicaSystem.class);
@@ -299,7 +300,7 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
return finalStatus;
} catch (TTransportException | AccumuloException | AccumuloSecurityException e) {
log.warn("Could not connect to remote server {}, will retry", peerTserverStr, e);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index 82ae205..6b19b26 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -27,6 +27,7 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.impl.KeyExtent;
@@ -36,7 +37,6 @@ import org.apache.accumulo.core.trace.Span;
import org.apache.accumulo.core.trace.Trace;
import org.apache.accumulo.core.util.MapCounter;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.server.ServerConstants;
import org.apache.accumulo.server.fs.FileRef;
@@ -51,6 +51,8 @@ import org.apache.accumulo.tserver.TLevel;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
class DatafileManager {
private final Logger log = Logger.getLogger(DatafileManager.class);
// access to datafilesizes needs to be synchronized: see CompactionRunner#getNumFiles
@@ -353,7 +355,7 @@ class DatafileManager {
break;
} catch (IOException ioe) {
log.warn("Tablet " + tablet.getExtent() + " failed to rename " + newDatafile + " after MinC, will retry in 60 secs...", ioe);
- UtilWaitThread.sleep(60 * 1000);
+ sleepUninterruptibly(1, TimeUnit.MINUTES);
}
} while (true);
@@ -426,7 +428,7 @@ class DatafileManager {
break;
} catch (IOException e) {
log.error("Failed to write to write-ahead log " + e.getMessage() + " will retry", e);
- UtilWaitThread.sleep(1 * 1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
} while (true);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
index 490ecd3..3171fcb 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
@@ -20,13 +20,13 @@ import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.impl.Tables;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.core.metadata.schema.DataFileValue;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.conf.TableConfiguration;
import org.apache.accumulo.server.fs.FileRef;
import org.apache.accumulo.server.problems.ProblemReport;
@@ -39,6 +39,8 @@ import org.apache.hadoop.fs.Path;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class MinorCompactor extends Compactor {
private static final Logger log = LoggerFactory.getLogger(MinorCompactor.class);
@@ -122,7 +124,7 @@ public class MinorCompactor extends Compactor {
int sleep = sleepTime + random.nextInt(sleepTime);
log.debug("MinC failed sleeping " + sleep + " ms before retrying");
- UtilWaitThread.sleep(sleep);
+ sleepUninterruptibly(sleep, TimeUnit.MILLISECONDS);
sleepTime = (int) Math.round(Math.min(maxSleepTime, sleepTime * growthFactor));
// clean up
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 8fcf035..ad3fb47 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -88,7 +88,6 @@ import org.apache.accumulo.core.trace.Span;
import org.apache.accumulo.core.trace.Trace;
import org.apache.accumulo.core.util.LocalityGroupUtil;
import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.ServerConstants;
import org.apache.accumulo.server.conf.TableConfiguration;
import org.apache.accumulo.server.fs.FileRef;
@@ -150,6 +149,7 @@ import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
*
@@ -1294,7 +1294,7 @@ public class Tablet implements TabletCommitter {
} catch (RuntimeException t) {
err = t;
log.error("Consistency check fails, retrying " + t);
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
}
if (err != null) {
@@ -2605,7 +2605,7 @@ public class Tablet implements TabletCommitter {
}
log.warn("Failed to create dir for tablet in table " + tableId + " in volume " + volume + " + will retry ...");
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
index 86e44e7..4506f28 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TraceCommand.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.shell.commands;
import java.io.IOException;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.conf.Property;
@@ -25,13 +26,14 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.trace.Trace;
import org.apache.accumulo.core.util.BadArgumentException;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.shell.Shell;
import org.apache.accumulo.tracer.TraceDump;
import org.apache.accumulo.tracer.TraceDump.Printer;
import org.apache.commons.cli.CommandLine;
import org.apache.hadoop.io.Text;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class TraceCommand extends DebugCommand {
@Override
@@ -74,7 +76,7 @@ public class TraceCommand extends DebugCommand {
}
shellState.getReader().println("Waiting for trace information");
shellState.getReader().flush();
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
if (traceCount < 0) {
// display the trace even though there are unrooted spans
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/AssignmentThreadsIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/AssignmentThreadsIT.java b/test/src/main/java/org/apache/accumulo/test/AssignmentThreadsIT.java
index 5e60388..48955f8 100644
--- a/test/src/main/java/org/apache/accumulo/test/AssignmentThreadsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/AssignmentThreadsIT.java
@@ -21,18 +21,19 @@ import static org.junit.Assert.assertTrue;
import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
-import org.apache.accumulo.test.PerformanceTest;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// ACCUMULO-1177
@Category(PerformanceTest.class)
public class AssignmentThreadsIT extends ConfigurableMacBase {
@@ -85,7 +86,7 @@ public class AssignmentThreadsIT extends ConfigurableMacBase {
log.info("Taking table offline, again");
c.tableOperations().offline(tableName, true);
// wait >10 seconds for thread pool to update
- UtilWaitThread.sleep(Math.max(0, now + 11 * 1000 - System.currentTimeMillis()));
+ sleepUninterruptibly(Math.max(0, now + 11 * 1000 - System.currentTimeMillis()), TimeUnit.MILLISECONDS);
now = System.currentTimeMillis();
log.info("Bringing table back online");
c.tableOperations().online(tableName, true);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
index 5b0b84d..5dfc136 100644
--- a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
@@ -32,7 +33,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooLock;
@@ -48,6 +48,8 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// Accumulo3047
public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(BadDeleteMarkersCreatedIT.class);
@@ -158,7 +160,7 @@ public class BadDeleteMarkersCreatedIT extends AccumuloClusterHarness {
c.tableOperations().delete(tableName);
log.info("Sleeping to let garbage collector run");
// let gc run
- UtilWaitThread.sleep(timeoutFactor * 15 * 1000);
+ sleepUninterruptibly(timeoutFactor * 15, TimeUnit.SECONDS);
log.info("Verifying that delete markers were deleted");
// look for delete markers
Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
index 660051e..15a19a3 100644
--- a/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/BalanceFasterIT.java
@@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
@@ -33,17 +34,17 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
import org.apache.accumulo.test.mrit.IntegrationTestMapReduce;
-import org.apache.accumulo.test.PerformanceTest;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// ACCUMULO-2952
@Category(PerformanceTest.class)
public class BalanceFasterIT extends ConfigurableMacBase {
@@ -70,7 +71,7 @@ public class BalanceFasterIT extends ConfigurableMacBase {
}
conn.tableOperations().addSplits(tableName, splits);
// give a short wait for balancing
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
// find out where the tabets are
Scanner s = conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
s.fetchColumnFamily(MetadataSchema.TabletsSection.CurrentLocationColumnFamily.NAME);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java b/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
index 2474b3e..91b929f 100644
--- a/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/CleanWalIT.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -33,7 +34,6 @@ import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -46,6 +46,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class CleanWalIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(CleanWalIT.class);
@@ -119,7 +120,7 @@ public class CleanWalIT extends AccumuloClusterHarness {
conn.tableOperations().flush(RootTable.NAME, null, null, true);
try {
getCluster().getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
- UtilWaitThread.sleep(3 * 1000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
} finally {
getCluster().getClusterControl().startAllServers(ServerType.TABLET_SERVER);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 74d3593..4f915d3 100644
--- a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -79,7 +79,6 @@ import org.apache.accumulo.core.trace.DistributedTrace;
import org.apache.accumulo.core.trace.Span;
import org.apache.accumulo.core.trace.Trace;
import org.apache.accumulo.core.util.FastFormat;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
@@ -97,6 +96,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterables;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
*
@@ -652,7 +652,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
conn.tableOperations().create(tableName);
conn.tableOperations().addSplits(tableName, nss("2", "4", "6"));
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
int num = 100;
@@ -1286,7 +1286,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
if (!conn.tableOperations().exists("trace")) {
tracer = mac.exec(TraceServer.class);
while (!conn.tableOperations().exists("trace")) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -1294,7 +1294,7 @@ public class ConditionalWriterIT extends AccumuloClusterHarness {
conn.tableOperations().create(tableName);
DistributedTrace.enable("localhost", "testTrace", mac.getClientConfig());
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
Span root = Trace.on("traceTest");
ConditionalWriter cw = conn.createConditionalWriter(tableName, new ConditionalWriterConfig());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
index 52d2086..d4f4d58 100644
--- a/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ExistingMacIT.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -38,7 +39,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -50,6 +50,8 @@ import org.apache.hadoop.fs.RawLocalFileSystem;
import org.junit.Assert;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ExistingMacIT extends ConfigurableMacBase {
@Override
public int defaultTimeoutSeconds() {
@@ -101,7 +103,7 @@ public class ExistingMacIT extends ConfigurableMacBase {
}
// TODO clean out zookeeper? following sleep waits for ephemeral nodes to go away
- UtilWaitThread.sleep(10000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
File hadoopConfDir = createTestDir(ExistingMacIT.class.getSimpleName() + "_hadoop_conf");
FileUtils.deleteQuietly(hadoopConfDir);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
index 1c3d89e..0f00caf 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -42,10 +43,10 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.util.FastFormat;
import org.apache.accumulo.core.util.Stat;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
/**
*
@@ -180,7 +181,7 @@ public class IMMLGBenchmark {
conn.tableOperations().setLocalityGroups(table, groups);
conn.tableOperations().offline(table);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
conn.tableOperations().online(table);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index 84a5996..73714c5 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.core.client.BatchWriter;
@@ -35,7 +36,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
import org.apache.accumulo.test.functional.SlowIterator;
@@ -43,6 +43,7 @@ import org.apache.hadoop.conf.Configuration;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class MetaGetsReadersIT extends ConfigurableMacBase {
@@ -98,7 +99,7 @@ public class MetaGetsReadersIT extends ConfigurableMacBase {
t1.start();
Thread t2 = slowScan(c, tableName, stop);
t2.start();
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
long now = System.currentTimeMillis();
Scanner m = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
Iterators.size(m.iterator());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
index 37e4957..d584613 100644
--- a/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.core.client.BatchWriter;
@@ -32,7 +33,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
@@ -41,6 +41,7 @@ import org.apache.hadoop.fs.RawLocalFileSystem;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class MultiTableRecoveryIT extends ConfigurableMacBase {
@@ -116,7 +117,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacBase {
try {
int i = 0;
while (!stop.get()) {
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
System.out.println("Restarting");
getCluster().getClusterControl().stop(ServerType.TABLET_SERVER);
getCluster().start();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java b/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
index 0ecdd0d..b407ead 100644
--- a/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/NamespacesIT.java
@@ -34,6 +34,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.cluster.ClusterUser;
import org.apache.accumulo.core.client.AccumuloException;
@@ -74,7 +75,6 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.NamespacePermission;
import org.apache.accumulo.core.security.SystemPermission;
import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
@@ -83,6 +83,8 @@ import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// Testing default namespace configuration with inheritance requires altering the system state and restoring it back to normal
// Punt on this for now and just let it use a minicluster.
public class NamespacesIT extends AccumuloClusterHarness {
@@ -329,7 +331,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
// verify entry is filtered out (also, verify conflict checking API)
c.namespaceOperations().checkIteratorConflicts(namespace, setting, EnumSet.allOf(IteratorScope.class));
c.namespaceOperations().attachIterator(namespace, setting);
- UtilWaitThread.sleep(2 * 1000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
try {
c.namespaceOperations().checkIteratorConflicts(namespace, setting, EnumSet.allOf(IteratorScope.class));
fail();
@@ -345,7 +347,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
// verify can see inserted entry again
c.namespaceOperations().removeIterator(namespace, setting.getName(), EnumSet.allOf(IteratorScope.class));
- UtilWaitThread.sleep(2 * 1000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
assertFalse(c.namespaceOperations().listIterators(namespace).containsKey(iterName));
assertFalse(c.tableOperations().listIterators(t1).containsKey(iterName));
s = c.createScanner(t1, Authorizations.EMPTY);
@@ -485,7 +487,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
int num = c.namespaceOperations().listConstraints(namespace).get(constraintClassName);
assertEquals(num, (int) c.tableOperations().listConstraints(t1).get(constraintClassName));
// doesn't take effect immediately, needs time to propagate to tserver's ZooKeeper cache
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
Mutation m1 = new Mutation("r1");
Mutation m2 = new Mutation("r2");
@@ -506,7 +508,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
assertFalse(c.namespaceOperations().listConstraints(namespace).containsKey(constraintClassName));
assertFalse(c.tableOperations().listConstraints(t1).containsKey(constraintClassName));
// doesn't take effect immediately, needs time to propagate to tserver's ZooKeeper cache
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
bw = c.createBatchWriter(t1, new BatchWriterConfig());
bw.addMutations(Arrays.asList(m1, m2, m3));
@@ -817,7 +819,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
// set the filter, verify that accumulo namespace is the only one unaffected
c.instanceOperations().setProperty(k, v);
// doesn't take effect immediately, needs time to propagate to tserver's ZooKeeper cache
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
assertTrue(c.instanceOperations().getSystemConfiguration().containsValue(v));
assertEquals(systemNamespaceShouldInherit, checkNamespaceHasProp(Namespaces.ACCUMULO_NAMESPACE, k, v));
assertEquals(systemNamespaceShouldInherit, checkTableHasProp(RootTable.NAME, k, v));
@@ -830,7 +832,7 @@ public class NamespacesIT extends AccumuloClusterHarness {
// verify it is no longer inherited
c.instanceOperations().removeProperty(k);
// doesn't take effect immediately, needs time to propagate to tserver's ZooKeeper cache
- UtilWaitThread.sleep(250);
+ sleepUninterruptibly(250, TimeUnit.MILLISECONDS);
assertFalse(c.instanceOperations().getSystemConfiguration().containsValue(v));
assertFalse(checkNamespaceHasProp(Namespaces.ACCUMULO_NAMESPACE, k, v));
assertFalse(checkTableHasProp(RootTable.NAME, k, v));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/NativeMapPerformanceTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/NativeMapPerformanceTest.java b/test/src/main/java/org/apache/accumulo/test/NativeMapPerformanceTest.java
index 0285092..b5293dc 100644
--- a/test/src/main/java/org/apache/accumulo/test/NativeMapPerformanceTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/NativeMapPerformanceTest.java
@@ -25,15 +25,17 @@ import java.util.Random;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentSkipListMap;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.util.FastFormat;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.tserver.NativeMap;
import org.apache.hadoop.io.Text;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class NativeMapPerformanceTest {
private static final byte ROW_PREFIX[] = new byte[] {'r'};
@@ -170,7 +172,7 @@ public class NativeMapPerformanceTest {
System.gc();
System.gc();
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
System.out.printf("mapType:%10s put rate:%,6.2f scan rate:%,6.2f get rate:%,6.2f delete time : %6.2f mem : %,d%n", "" + mapType, (numRows * numCols)
/ ((tpe - tps) / 1000.0), (size) / ((tie - tis) / 1000.0), numLookups / ((tge - tgs) / 1000.0), (tde - tds) / 1000.0, memUsed);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index cf22df5..b51e02b 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -38,6 +38,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import jline.console.ConsoleReader;
@@ -61,7 +62,6 @@ import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileSKVWriter;
import org.apache.accumulo.core.metadata.MetadataTable;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.SharedMiniClusterBase;
import org.apache.accumulo.shell.Shell;
import org.apache.accumulo.test.functional.SlowIterator;
@@ -87,6 +87,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ShellServerIT extends SharedMiniClusterBase {
public static class TestOutputStream extends OutputStream {
@@ -261,7 +262,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
// give the tracer some time to start
while (!tops.exists("trace")) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
@@ -704,7 +705,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("getauths", true, "bar", true);
passed = true;
} catch (Exception e) {
- UtilWaitThread.sleep(300);
+ sleepUninterruptibly(300, TimeUnit.MILLISECONDS);
}
}
assertTrue("Could not successfully see updated authoriations", passed);
@@ -1000,7 +1001,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("constraint -l -t " + table, true, "VisibilityConstraint=2", true);
ts.exec("constraint -t " + table + " -d 2", true, "Removed constraint 2 from table " + table);
// wait for zookeeper updates to propagate
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
ts.exec("constraint -l -t " + table, true, "VisibilityConstraint=2", false);
ts.exec("deletetable -f " + table);
}
@@ -1196,7 +1197,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("scan -b 02", true, "value", false);
ts.exec("interpreter -i org.apache.accumulo.core.util.interpret.HexScanInterpreter", true);
// Need to allow time for this to propagate through zoocache/zookeeper
- UtilWaitThread.sleep(3000);
+ sleepUninterruptibly(3, TimeUnit.SECONDS);
ts.exec("interpreter -l", true, "HexScan", true);
ts.exec("scan -b 02", true, "value", true);
@@ -1265,7 +1266,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
// wait for both tservers to start up
if (ts.output.get().split("\n").length == 3)
break;
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
assertEquals(3, ts.output.get().split("\n").length);
@@ -1347,7 +1348,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
log.info("Ignoring scan because of wrong table: " + currentScan);
}
}
- UtilWaitThread.sleep(300);
+ sleepUninterruptibly(300, TimeUnit.MILLISECONDS);
}
thread.join();
@@ -1391,7 +1392,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("createtable " + table, true);
ts.exec("config -t " + table + " -s " + Property.TABLE_CLASSPATH.getKey() + "=cx1", true);
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
// We can't use the setiter command as Filter implements OptionDescriber which
// forces us to enter more input that I don't know how to input
@@ -1400,7 +1401,7 @@ public class ShellServerIT extends SharedMiniClusterBase {
ts.exec("insert foo f q v", true);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
ts.exec("scan -np", true, "foo", false);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java b/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
index 4cad3a7..fc54b64 100644
--- a/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/SplitCancelsMajCIT.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertTrue;
import java.util.EnumSet;
import java.util.SortedSet;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.client.BatchWriter;
@@ -30,12 +31,13 @@ import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.SharedMiniClusterBase;
import org.apache.accumulo.test.functional.SlowIterator;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// ACCUMULO-2862
public class SplitCancelsMajCIT extends SharedMiniClusterBase {
@@ -75,7 +77,7 @@ public class SplitCancelsMajCIT extends SharedMiniClusterBase {
thread.start();
long now = System.currentTimeMillis();
- UtilWaitThread.sleep(10 * 1000);
+ sleepUninterruptibly(10, TimeUnit.SECONDS);
// split the table, interrupts the compaction
SortedSet<Text> partitionKeys = new TreeSet<Text>();
partitionKeys.add(new Text("10"));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
index 298c761..3f8c30c 100644
--- a/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/SplitRecoveryIT.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -35,12 +36,12 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class SplitRecoveryIT extends AccumuloClusterHarness {
@@ -81,7 +82,7 @@ public class SplitRecoveryIT extends AccumuloClusterHarness {
// take the table offline
connector.tableOperations().offline(tableName);
while (!isOffline(tableName, connector))
- UtilWaitThread.sleep(200);
+ sleepUninterruptibly(200, TimeUnit.MILLISECONDS);
// poke a partial split into the metadata table
connector.securityOperations().grantTablePermission(getAdminPrincipal(), MetadataTable.NAME, TablePermission.WRITE);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
index 789b089..7d6e6bd 100644
--- a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -34,6 +34,7 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -55,7 +56,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.test.functional.BadIterator;
import org.apache.hadoop.io.Text;
@@ -66,6 +66,7 @@ import org.junit.Test;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class TableOperationsIT extends AccumuloClusterHarness {
@@ -361,7 +362,7 @@ public class TableOperationsIT extends AccumuloClusterHarness {
List<IteratorSetting> list = new ArrayList<>();
list.add(new IteratorSetting(15, BadIterator.class));
connector.tableOperations().compact(tableName, null, null, list, true, false); // don't block
- UtilWaitThread.sleep(2000); // start compaction
+ sleepUninterruptibly(2, TimeUnit.SECONDS); // start compaction
connector.tableOperations().cancelCompaction(tableName);
Scanner scanner = connector.createScanner(tableName, Authorizations.EMPTY);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
index 06bf394..944b310 100644
--- a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java
@@ -19,17 +19,19 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertEquals;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
// ACCUMULO-2480
public class TabletServerGivesUpIT extends ConfigurableMacBase {
@@ -66,7 +68,7 @@ public class TabletServerGivesUpIT extends ConfigurableMacBase {
splitter.start();
// wait for the tserver to give up on writing to the WAL
while (conn.instanceOperations().getTabletServers().size() == 1) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
index bf2e7f1..be800ad 100644
--- a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
@@ -29,7 +29,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.MemoryUnit;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.server.AccumuloServerContext;
@@ -39,6 +38,7 @@ import org.apache.hadoop.conf.Configuration;
import org.junit.Test;
import com.google.common.net.HostAndPort;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
// see ACCUMULO-1950
public class TotalQueuedIT extends ConfigurableMacBase {
@@ -63,7 +63,7 @@ public class TotalQueuedIT extends ConfigurableMacBase {
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "9999");
c.tableOperations().setProperty(tableName, Property.TABLE_FILE_MAX.getKey(), "999");
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// get an idea of how fast the syncs occur
byte row[] = new byte[250];
BatchWriterConfig cfg = new BatchWriterConfig();
@@ -94,7 +94,7 @@ public class TotalQueuedIT extends ConfigurableMacBase {
// Now with a much bigger total queue
c.instanceOperations().setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(), "" + LARGE_QUEUE_SIZE);
c.tableOperations().flush(tableName, null, null, true);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
bw = c.createBatchWriter(tableName, cfg);
now = System.currentTimeMillis();
bytesSent = 0;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
index 1c6e3df..72f87aa 100644
--- a/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TracerRecoversAfterOfflineTableIT.java
@@ -18,6 +18,8 @@ package org.apache.accumulo.test;
import static org.junit.Assert.assertTrue;
+import java.util.concurrent.TimeUnit;
+
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
@@ -27,7 +29,6 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.trace.DistributedTrace;
import org.apache.accumulo.core.trace.Span;
import org.apache.accumulo.core.trace.Trace;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
@@ -38,6 +39,8 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
*
*/
@@ -61,9 +64,9 @@ public class TracerRecoversAfterOfflineTableIT extends ConfigurableMacBase {
MiniAccumuloClusterImpl mac = cluster;
tracer = mac.exec(TraceServer.class);
while (!conn.tableOperations().exists("trace")) {
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
}
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
}
log.info("Taking table offline");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
index 2c32176..dc77f37 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousBatchWalker.java
@@ -35,11 +35,11 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.validators.PositiveInteger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ContinuousBatchWalker {
@@ -76,7 +76,7 @@ public class ContinuousBatchWalker {
runBatchScan(scanOpts.scanBatchSize, bs, batch, ranges);
- UtilWaitThread.sleep(opts.sleepTime);
+ sleepUninterruptibly(opts.sleepTime, TimeUnit.MILLISECONDS);
}
}
@@ -157,7 +157,7 @@ public class ContinuousBatchWalker {
System.out.println("FSB " + t1 + " " + (t2 - t1) + " " + count);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
}
HashSet<Text> ret = new HashSet<Text>();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousScanner.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousScanner.java b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousScanner.java
index a77de3d..63709df 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousScanner.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousScanner.java
@@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.cli.ClientOnDefaultTable;
import org.apache.accumulo.core.cli.ScannerOpts;
@@ -30,11 +31,11 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.hadoop.io.Text;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.validators.PositiveInteger;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ContinuousScanner {
@@ -100,7 +101,7 @@ public class ContinuousScanner {
System.out.printf("SCN %d %s %d %d%n", t1, new String(scanStart, UTF_8), (t2 - t1), count);
if (opts.sleepTime > 0)
- UtilWaitThread.sleep(opts.sleepTime);
+ sleepUninterruptibly(opts.sleepTime, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
index 118f053..1d38126 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/AccumuloInputFormatIT.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -42,7 +43,6 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -52,6 +52,8 @@ import org.apache.hadoop.mapreduce.Job;
import org.junit.Before;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class AccumuloInputFormatIT extends AccumuloClusterHarness {
AccumuloInputFormat inputFormat;
@@ -108,7 +110,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness {
for (int i = 0; i < 10000; i += 1000)
splitsToAdd.add(new Text(String.format("%09d", i)));
conn.tableOperations().addSplits(table, splitsToAdd);
- UtilWaitThread.sleep(500); // wait for splits to be propagated
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS); // wait for splits to be propagated
// get splits without setting any range
Collection<Text> actualSplits = conn.tableOperations().listSplits(table);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/AddSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/AddSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/AddSplitIT.java
index 4b4aeac..ddaca1e 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/AddSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/AddSplitIT.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.TreeSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -34,11 +35,12 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class AddSplitIT extends AccumuloClusterHarness {
@Override
@@ -61,7 +63,7 @@ public class AddSplitIT extends AccumuloClusterHarness {
c.tableOperations().addSplits(tableName, splits);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
Collection<Text> actualSplits = c.tableOperations().listSplits(tableName);
@@ -81,7 +83,7 @@ public class AddSplitIT extends AccumuloClusterHarness {
c.tableOperations().addSplits(tableName, splits);
- UtilWaitThread.sleep(100);
+ sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
actualSplits = c.tableOperations().listSplits(tableName);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
index 4c6fc00..c730f9b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BadIteratorMincIT.java
@@ -20,6 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import java.util.EnumSet;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -30,12 +31,12 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class BadIteratorMincIT extends AccumuloClusterHarness {
@@ -61,7 +62,7 @@ public class BadIteratorMincIT extends AccumuloClusterHarness {
bw.close();
c.tableOperations().flush(tableName, null, null, false);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// minc should fail, so there should be no files
FunctionalTestUtils.checkRFiles(c, tableName, 1, 1, 0, 0);
@@ -74,7 +75,7 @@ public class BadIteratorMincIT extends AccumuloClusterHarness {
// remove the bad iterator
c.tableOperations().removeIterator(tableName, BadIterator.class.getSimpleName(), EnumSet.of(IteratorScope.minc));
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
// minc should complete
FunctionalTestUtils.checkRFiles(c, tableName, 1, 1, 1, 1);
@@ -93,12 +94,12 @@ public class BadIteratorMincIT extends AccumuloClusterHarness {
bw.close();
// make sure property is given time to propagate
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
c.tableOperations().flush(tableName, null, null, false);
// make sure the flush has time to start
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// this should not hang
c.tableOperations().delete(tableName);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
index 14295c4..7d36cd2 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BatchScanSplitIT.java
@@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.BatchWriter;
@@ -34,7 +35,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -43,6 +43,8 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class BatchScanSplitIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(BatchScanSplitIT.class);
@@ -80,7 +82,7 @@ public class BatchScanSplitIT extends AccumuloClusterHarness {
Collection<Text> splits = getConnector().tableOperations().listSplits(tableName);
while (splits.size() < 2) {
- UtilWaitThread.sleep(1);
+ sleepUninterruptibly(1, TimeUnit.MILLISECONDS);
splits = getConnector().tableOperations().listSplits(tableName);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
index 7c05a0f..353a6b9 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
@@ -36,12 +36,12 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.hadoop.io.Text;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class BatchWriterFlushIT extends AccumuloClusterHarness {
@@ -74,7 +74,7 @@ public class BatchWriterFlushIT extends AccumuloClusterHarness {
m.put(new Text("cf"), new Text("cq"), new Value("1".getBytes(UTF_8)));
bw.addMutation(m);
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
int count = Iterators.size(scanner.iterator());
@@ -82,7 +82,7 @@ public class BatchWriterFlushIT extends AccumuloClusterHarness {
throw new Exception("Flushed too soon");
}
- UtilWaitThread.sleep(1500);
+ sleepUninterruptibly(1500, TimeUnit.MILLISECONDS);
count = Iterators.size(scanner.iterator());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
index 226f8f1..bf0b618 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationIT.java
@@ -18,6 +18,8 @@ package org.apache.accumulo.test.functional;
import static com.google.common.base.Charsets.UTF_8;
+import java.util.concurrent.TimeUnit;
+
import org.apache.accumulo.core.cli.ClientOpts.Password;
import org.apache.accumulo.core.cli.ScannerOpts;
import org.apache.accumulo.core.client.ClientConfiguration;
@@ -26,7 +28,6 @@ import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
@@ -40,6 +41,8 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
/**
* This test verifies that when a lot of files are bulk imported into a table with one tablet and then splits that not all map files go to the children tablets.
*/
@@ -103,11 +106,11 @@ public class BulkSplitOptimizationIT extends AccumuloClusterHarness {
// initiate splits
getConnector().tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "100K");
- UtilWaitThread.sleep(2000);
+ sleepUninterruptibly(2, TimeUnit.SECONDS);
// wait until over split threshold -- should be 78 splits
while (getConnector().tableOperations().listSplits(tableName).size() < 75) {
- UtilWaitThread.sleep(500);
+ sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
}
FunctionalTestUtils.checkSplits(c, tableName, 50, 100);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
index fd8ba2c..7935aa4 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestReader.java
@@ -25,11 +25,13 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class CacheTestReader {
public static void main(String[] args) throws Exception {
String rootDir = args[0];
@@ -77,7 +79,7 @@ public class CacheTestReader {
fos.close();
oos.close();
- UtilWaitThread.sleep(20);
+ sleepUninterruptibly(20, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestWriter.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestWriter.java b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestWriter.java
index 76e8168..5d05a71 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/CacheTestWriter.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/CacheTestWriter.java
@@ -27,13 +27,15 @@ import java.util.Map;
import java.util.Random;
import java.util.TreeMap;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class CacheTestWriter {
static final int NUM_DATA = 3;
@@ -156,7 +158,7 @@ public class CacheTestWriter {
break;
}
- UtilWaitThread.sleep(5);
+ sleepUninterruptibly(5, TimeUnit.MILLISECONDS);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ClassLoaderIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
index acbb699..29f2780 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ClassLoaderIT.java
@@ -26,6 +26,7 @@ import java.util.Collections;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -38,7 +39,6 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.Combiner;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.hadoop.fs.FSDataOutputStream;
@@ -49,6 +49,8 @@ import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ClassLoaderIT extends AccumuloClusterHarness {
private static final long ZOOKEEPER_PROPAGATION_TIME = 10 * 1000;
@@ -94,15 +96,15 @@ public class ClassLoaderIT extends AccumuloClusterHarness {
FileSystem fs = getCluster().getFileSystem();
Path jarPath = new Path(rootPath + "/lib/ext/Test.jar");
copyStreamToFileSystem(fs, "/TestCombinerX.jar", jarPath);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
IteratorSetting is = new IteratorSetting(10, "TestCombiner", "org.apache.accumulo.test.functional.TestCombiner");
Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf")));
c.tableOperations().attachIterator(tableName, is, EnumSet.of(IteratorScope.scan));
- UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME);
+ sleepUninterruptibly(ZOOKEEPER_PROPAGATION_TIME, TimeUnit.MILLISECONDS);
scanCheck(c, tableName, "TestX");
fs.delete(jarPath, true);
copyStreamToFileSystem(fs, "/TestCombinerY.jar", jarPath);
- UtilWaitThread.sleep(5000);
+ sleepUninterruptibly(5, TimeUnit.SECONDS);
scanCheck(c, tableName, "TestY");
fs.delete(jarPath, true);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
index 75eecfd..d462b53 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConcurrencyIT.java
@@ -20,6 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.EnumSet;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -36,7 +37,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -44,6 +44,7 @@ import org.apache.hadoop.io.Text;
import org.junit.Test;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class ConcurrencyIT extends AccumuloClusterHarness {
@@ -117,7 +118,7 @@ public class ConcurrencyIT extends AccumuloClusterHarness {
ScanTask st1 = new ScanTask(c, tableName, 100);
st1.start();
- UtilWaitThread.sleep(50);
+ sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
c.tableOperations().flush(tableName, null, null, true);
for (int i = 0; i < 50; i++) {
@@ -142,7 +143,7 @@ public class ConcurrencyIT extends AccumuloClusterHarness {
ScanTask st3 = new ScanTask(c, tableName, 150);
st3.start();
- UtilWaitThread.sleep(50);
+ sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
c.tableOperations().flush(tableName, null, null, false);
st3.join();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/ConstraintIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConstraintIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ConstraintIT.java
index 4ef4a61..5817b03 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ConstraintIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ConstraintIT.java
@@ -23,6 +23,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -36,7 +37,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint;
import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
import org.apache.accumulo.harness.AccumuloClusterHarness;
@@ -45,6 +45,8 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
+
public class ConstraintIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(ConstraintIT.class);
@@ -155,7 +157,7 @@ public class ConstraintIT extends AccumuloClusterHarness {
// remove the numeric value constraint
getConnector().tableOperations().removeConstraint(tableName, 2);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// now should be able to add a non numeric value
bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
@@ -178,7 +180,7 @@ public class ConstraintIT extends AccumuloClusterHarness {
// add a constraint that references a non-existant class
getConnector().tableOperations().setProperty(tableName, Property.TABLE_CONSTRAINT_PREFIX + "1", "com.foobar.nonExistantClass");
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// add a mutation
bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
@@ -218,7 +220,7 @@ public class ConstraintIT extends AccumuloClusterHarness {
// remove the bad constraint
getConnector().tableOperations().removeConstraint(tableName, 1);
- UtilWaitThread.sleep(1000);
+ sleepUninterruptibly(1, TimeUnit.SECONDS);
// try the mutation again
bw = getConnector().createBatchWriter(tableName, new BatchWriterConfig());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7ec6291a/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java
index 2650c89..4577813 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java
@@ -20,6 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -31,7 +32,6 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.harness.AccumuloClusterHarness;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.hadoop.conf.Configuration;
@@ -42,6 +42,7 @@ import org.junit.Test;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
+import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
public class DeleteEverythingIT extends AccumuloClusterHarness {
@@ -103,7 +104,7 @@ public class DeleteEverythingIT extends AccumuloClusterHarness {
getConnector().tableOperations().flush(tableName, null, null, true);
getConnector().tableOperations().setProperty(tableName, Property.TABLE_MAJC_RATIO.getKey(), "1.0");
- UtilWaitThread.sleep(4000);
+ sleepUninterruptibly(4, TimeUnit.SECONDS);
FunctionalTestUtils.checkRFiles(c, tableName, 1, 1, 0, 0);
[3/6] accumulo git commit: ACCUMULO-2346 update all sleeps to a
specific time unit
Posted by ec...@apache.org.
ACCUMULO-2346 update all sleeps to a specific time unit
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5dbb768d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5dbb768d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5dbb768d
Branch: refs/heads/master
Commit: 5dbb768d7f503d87929bbd0fcd1b8c1b827cc10a
Parents: b3692d4
Author: Eric C. Newton <er...@gmail.com>
Authored: Fri Jul 17 12:58:49 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Fri Jul 17 12:58:49 2015 -0400
----------------------------------------------------------------------
.../accumulo/core/util/UtilWaitThread.java | 28 --------------------
1 file changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5dbb768d/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java b/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
deleted file mode 100644
index 816d8ed..0000000
--- a/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.core.util;
-
-import java.util.concurrent.TimeUnit;
-
-import com.google.common.util.concurrent.Uninterruptibles;
-
-public class UtilWaitThread {
-
- public static void sleep(long millis) {
- Uninterruptibles.sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
- }
-}
[2/6] accumulo git commit: ACCUMULO-2346 use
Uninterruptibles.sleepUninterruptibly
Posted by ec...@apache.org.
ACCUMULO-2346 use Uninterruptibles.sleepUninterruptibly
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b3692d46
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b3692d46
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b3692d46
Branch: refs/heads/master
Commit: b3692d464e8834f7ef561a45bc39509898b2741f
Parents: 1148751
Author: Eric C. Newton <er...@gmail.com>
Authored: Wed Jul 15 16:19:51 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Wed Jul 15 16:19:51 2015 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/core/util/UtilWaitThread.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b3692d46/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java b/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
index 01f5fa8..816d8ed 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/UtilWaitThread.java
@@ -16,17 +16,13 @@
*/
package org.apache.accumulo.core.util;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.concurrent.TimeUnit;
+
+import com.google.common.util.concurrent.Uninterruptibles;
public class UtilWaitThread {
- private static final Logger log = LoggerFactory.getLogger(UtilWaitThread.class);
public static void sleep(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- log.error("{}", e.getMessage(), e);
- }
+ Uninterruptibles.sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
}
}