http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java b/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java index cacee7a..f9ce176 100644 --- a/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java +++ b/test/src/test/java/org/apache/accumulo/test/RewriteTabletDirectoriesIT.java @@ -93,7 +93,7 @@ public class RewriteTabletDirectoriesIT extends ConfigurableMacIT { for (String split : "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",")) { splits.add(new Text(split)); Mutation m = new Mutation(new Text(split)); - m.put(new byte[]{}, new byte[]{}, new byte[]{}); + m.put(new byte[] {}, new byte[] {}, new byte[] {}); bw.addMutation(m); } bw.close();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java index 44ddb50..9296548 100644 --- a/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java +++ b/test/src/test/java/org/apache/accumulo/test/ShellServerIT.java @@ -724,7 +724,7 @@ public class ShellServerIT extends SharedMiniClusterIT { if (entry.getKey().equals("table.custom.testProp")) Assert.assertTrue("Initial property was not set correctly", entry.getValue().equals("testProp")); - + if (entry.getKey().equals(Property.TABLE_SPLIT_THRESHOLD.getKey())) Assert.assertTrue("Initial property was not set correctly", entry.getValue().equals("10K")); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java b/test/src/test/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java index 73e0e81..94e0a3c 100644 --- a/test/src/test/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java +++ b/test/src/test/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java @@ -53,7 +53,8 @@ public class TableConfigurationUpdateIT extends AccumuloClusterIT { String table = getUniqueNames(1)[0]; conn.tableOperations().create(table); - final NamespaceConfiguration defaultConf = new NamespaceConfiguration(Namespaces.DEFAULT_NAMESPACE_ID, inst, AccumuloConfiguration.getDefaultConfiguration()); + final NamespaceConfiguration defaultConf = new NamespaceConfiguration(Namespaces.DEFAULT_NAMESPACE_ID, inst, + AccumuloConfiguration.getDefaultConfiguration()); // Cache invalidates 25% of the time int randomMax = 4; @@ -83,8 +84,8 @@ public class TableConfigurationUpdateIT extends AccumuloClusterIT { } long end = System.currentTimeMillis(); - log.debug(tableConf + " with " + iterations + " iterations and " + numThreads + " threads and cache invalidates " - + ((1. / randomMax) * 100.) + "% took " + (end - start) / 1000 + " second(s)"); + log.debug(tableConf + " with " + iterations + " iterations and " + numThreads + " threads and cache invalidates " + ((1. / randomMax) * 100.) + "% took " + + (end - start) / 1000 + " second(s)"); } public static class TableConfRunner implements Callable<Exception> { http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java index 0a62746..ac24083 100644 --- a/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java +++ b/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java @@ -16,6 +16,8 @@ */ package org.apache.accumulo.test; +import static org.junit.Assert.assertEquals; + import java.util.TreeSet; import java.util.concurrent.atomic.AtomicReference; @@ -28,11 +30,9 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; import org.junit.Test; -import static org.junit.Assert.assertEquals; - // ACCUMULO-2480 public class TabletServerGivesUpIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.useMiniDFS(true); @@ -50,7 +50,7 @@ public class TabletServerGivesUpIT extends ConfigurableMacIT { // Kill dfs cluster.getMiniDfs().shutdown(); // ask the tserver to do something - final AtomicReference<Exception> ex = new AtomicReference<>(); + final AtomicReference<Exception> ex = new AtomicReference<>(); Thread splitter = new Thread() { public void run() { try { @@ -68,5 +68,5 @@ public class TabletServerGivesUpIT extends ConfigurableMacIT { UtilWaitThread.sleep(1000); } } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/TotalQueuedIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TotalQueuedIT.java b/test/src/test/java/org/apache/accumulo/test/TotalQueuedIT.java index ad9d43c..708d2d4 100644 --- a/test/src/test/java/org/apache/accumulo/test/TotalQueuedIT.java +++ b/test/src/test/java/org/apache/accumulo/test/TotalQueuedIT.java @@ -42,14 +42,14 @@ import com.google.common.net.HostAndPort; // see ACCUMULO-1950 public class TotalQueuedIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setNumTservers(1); cfg.setDefaultMemory(cfg.getDefaultMemory() * 2, MemoryUnit.BYTE); cfg.useMiniDFS(); } - + int SMALL_QUEUE_SIZE = 100000; int LARGE_QUEUE_SIZE = SMALL_QUEUE_SIZE * 10; static final long N = 1000000; @@ -69,7 +69,7 @@ public class TotalQueuedIT extends ConfigurableMacIT { BatchWriterConfig cfg = new BatchWriterConfig(); cfg.setMaxWriteThreads(10); cfg.setMaxLatency(1, TimeUnit.SECONDS); - cfg.setMaxMemory(1024*1024); + cfg.setMaxMemory(1024 * 1024); long realSyncs = getSyncs(); BatchWriter bw = c.createBatchWriter(tableName, cfg); long now = System.currentTimeMillis(); @@ -86,11 +86,11 @@ public class TotalQueuedIT extends ConfigurableMacIT { double secs = diff / 1000.; double syncs = bytesSent / SMALL_QUEUE_SIZE; double syncsPerSec = syncs / secs; - System.out.println(String.format("Sent %d bytes in %f secs approximately %d syncs (%f syncs per sec)", bytesSent, secs, ((long)syncs), syncsPerSec)); + System.out.println(String.format("Sent %d bytes in %f secs approximately %d syncs (%f syncs per sec)", bytesSent, secs, ((long) syncs), syncsPerSec)); long update = getSyncs(); System.out.println("Syncs " + (update - realSyncs)); realSyncs = update; - + // 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); @@ -110,7 +110,7 @@ public class TotalQueuedIT extends ConfigurableMacIT { secs = diff / 1000.; syncs = bytesSent / LARGE_QUEUE_SIZE; syncsPerSec = syncs / secs; - System.out.println(String.format("Sent %d bytes in %f secs approximately %d syncs (%f syncs per sec)", bytesSent, secs, ((long)syncs), syncsPerSec)); + System.out.println(String.format("Sent %d bytes in %f secs approximately %d syncs (%f syncs per sec)", bytesSent, secs, ((long) syncs), syncsPerSec)); update = getSyncs(); System.out.println("Syncs " + (update - realSyncs)); assertTrue(update - realSyncs < realSyncs); @@ -127,5 +127,5 @@ public class TotalQueuedIT extends ConfigurableMacIT { } return 0; } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/TraceRepoDeserializationTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TraceRepoDeserializationTest.java b/test/src/test/java/org/apache/accumulo/test/TraceRepoDeserializationTest.java index 5215d3e..413a6c9 100644 --- a/test/src/test/java/org/apache/accumulo/test/TraceRepoDeserializationTest.java +++ b/test/src/test/java/org/apache/accumulo/test/TraceRepoDeserializationTest.java @@ -16,33 +16,27 @@ */ package org.apache.accumulo.test; +import static org.junit.Assert.fail; + import java.io.ByteArrayInputStream; import java.io.InvalidClassException; import java.io.ObjectInputStream; import org.apache.accumulo.core.util.Base64; import org.junit.Test; -import static org.junit.Assert.*; public class TraceRepoDeserializationTest { - + // Zookeeper data for a merge request - static private final String oldValue = - "rO0ABXNyAC1vcmcuYXBhY2hlLmFjY3VtdWxvLm1hc3Rlci50YWJsZU9wcy5UcmFjZVJlc" + - "G8AAAAAAAAAAQIAAkwABHJlcG90AB9Mb3JnL2FwYWNoZS9hY2N1bXVsby9mYXRlL1Jl" + - "cG87TAAFdGluZm90AChMb3JnL2FwYWNoZS9hY2N1bXVsby90cmFjZS90aHJpZnQvVEl" + - "uZm87eHBzcgAwb3JnLmFwYWNoZS5hY2N1bXVsby5tYXN0ZXIudGFibGVPcHMuVGFibG" + - "VSYW5nZU9wAAAAAAAAAAECAAVbAAZlbmRSb3d0AAJbQkwAC25hbWVzcGFjZUlkdAAST" + - "GphdmEvbGFuZy9TdHJpbmc7TAACb3B0AD1Mb3JnL2FwYWNoZS9hY2N1bXVsby9zZXJ2" + - "ZXIvbWFzdGVyL3N0YXRlL01lcmdlSW5mbyRPcGVyYXRpb247WwAIc3RhcnRSb3dxAH4A" + - "BUwAB3RhYmxlSWRxAH4ABnhyAC5vcmcuYXBhY2hlLmFjY3VtdWxvLm1hc3Rlci50YWJs" + - "ZU9wcy5NYXN0ZXJSZXBvAAAAAAAAAAECAAB4cHVyAAJbQqzzF/gGCFTgAgAAeHAAAAAA" + - "dAAIK2RlZmF1bHR+cgA7b3JnLmFwYWNoZS5hY2N1bXVsby5zZXJ2ZXIubWFzdGVyLnN0" + - "YXRlLk1lcmdlSW5mbyRPcGVyYXRpb24AAAAAAAAAABIAAHhyAA5qYXZhLmxhbmcuRW51" + - "bQAAAAAAAAAAEgAAeHB0AAVNRVJHRXEAfgALdAABMnNyACZvcmcuYXBhY2hlLmFjY3Vt" + - "dWxvLnRyYWNlLnRocmlmdC5USW5mb79UcL31bhZ9AwADQgAQX19pc3NldF9iaXRmaWVs" + - "ZEoACHBhcmVudElkSgAHdHJhY2VJZHhwdwUWABYAAHg="; - + static private final String oldValue = "rO0ABXNyAC1vcmcuYXBhY2hlLmFjY3VtdWxvLm1hc3Rlci50YWJsZU9wcy5UcmFjZVJlc" + + "G8AAAAAAAAAAQIAAkwABHJlcG90AB9Mb3JnL2FwYWNoZS9hY2N1bXVsby9mYXRlL1Jl" + "cG87TAAFdGluZm90AChMb3JnL2FwYWNoZS9hY2N1bXVsby90cmFjZS90aHJpZnQvVEl" + + "uZm87eHBzcgAwb3JnLmFwYWNoZS5hY2N1bXVsby5tYXN0ZXIudGFibGVPcHMuVGFibG" + "VSYW5nZU9wAAAAAAAAAAECAAVbAAZlbmRSb3d0AAJbQkwAC25hbWVzcGFjZUlkdAAST" + + "GphdmEvbGFuZy9TdHJpbmc7TAACb3B0AD1Mb3JnL2FwYWNoZS9hY2N1bXVsby9zZXJ2" + "ZXIvbWFzdGVyL3N0YXRlL01lcmdlSW5mbyRPcGVyYXRpb247WwAIc3RhcnRSb3dxAH4A" + + "BUwAB3RhYmxlSWRxAH4ABnhyAC5vcmcuYXBhY2hlLmFjY3VtdWxvLm1hc3Rlci50YWJs" + "ZU9wcy5NYXN0ZXJSZXBvAAAAAAAAAAECAAB4cHVyAAJbQqzzF/gGCFTgAgAAeHAAAAAA" + + "dAAIK2RlZmF1bHR+cgA7b3JnLmFwYWNoZS5hY2N1bXVsby5zZXJ2ZXIubWFzdGVyLnN0" + "YXRlLk1lcmdlSW5mbyRPcGVyYXRpb24AAAAAAAAAABIAAHhyAA5qYXZhLmxhbmcuRW51" + + "bQAAAAAAAAAAEgAAeHB0AAVNRVJHRXEAfgALdAABMnNyACZvcmcuYXBhY2hlLmFjY3Vt" + "dWxvLnRyYWNlLnRocmlmdC5USW5mb79UcL31bhZ9AwADQgAQX19pc3NldF9iaXRmaWVs" + + "ZEoACHBhcmVudElkSgAHdHJhY2VJZHhwdwUWABYAAHg="; + @Test(expected = InvalidClassException.class) public void test() throws Exception { byte bytes[] = Base64.decodeBase64(oldValue); @@ -51,5 +45,5 @@ public class TraceRepoDeserializationTest { ois.readObject(); fail("did not throw exception"); } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java index 525a29a..d1d4681 100644 --- a/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java +++ b/test/src/test/java/org/apache/accumulo/test/VerifySerialRecoveryIT.java @@ -14,7 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.accumulo.test; +package org.apache.accumulo.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.util.Map.Entry; import java.util.SortedSet; @@ -39,19 +43,15 @@ import org.apache.hadoop.fs.RawLocalFileSystem; import org.apache.hadoop.io.Text; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - public class VerifySerialRecoveryIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setNumTservers(1); cfg.setProperty(Property.TSERV_ASSIGNMENT_MAXCONCURRENT, "20"); hadoopCoreSite.set("fs.file.impl", RawLocalFileSystem.class.getName()); } - + @Test(timeout = 4 * 60 * 1000) public void testSerializedRecovery() throws Exception { // make a table with many splits @@ -75,9 +75,10 @@ public class VerifySerialRecoveryIT extends ConfigurableMacIT { for (ProcessReference ref : getCluster().getProcesses().get(ServerType.TABLET_SERVER)) getCluster().killProcess(ServerType.TABLET_SERVER, ref); final Process ts = cluster.exec(TabletServer.class); - + // wait for recovery - for (@SuppressWarnings("unused") Entry<Key,Value> entry : c.createScanner(tableName, Authorizations.EMPTY)) + for (@SuppressWarnings("unused") + Entry<Key,Value> entry : c.createScanner(tableName, Authorizations.EMPTY)) ; assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); ts.waitFor(); @@ -104,5 +105,5 @@ public class VerifySerialRecoveryIT extends ConfigurableMacIT { } assertFalse(started); assertTrue(recoveries > 0); - } + } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/BackupMasterIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BackupMasterIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BackupMasterIT.java index bf2d2e1..efed7a4 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BackupMasterIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BackupMasterIT.java @@ -39,7 +39,7 @@ public class BackupMasterIT extends ConfigurableMacIT { // create a backup Process backup = exec(Master.class); try { - ZooReaderWriter writer = new ZooReaderWriter(cluster.getZooKeepers(), 30*1000, "digest", "accumulo:DONTTELL".getBytes()); + ZooReaderWriter writer = new ZooReaderWriter(cluster.getZooKeepers(), 30 * 1000, "digest", "accumulo:DONTTELL".getBytes()); String root = "/accumulo/" + getConnector().getInstance().getInstanceID(); List<String> children = Collections.emptyList(); // wait for 2 lock entries http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java index a9ea5db..114d79b 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java @@ -64,10 +64,10 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterIT { @Override public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map<String,String> siteConfig = new HashMap<String, String>(); + Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_MAXMEM.getKey(), "10K"); siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "0"); - cfg.setSiteConfig(siteConfig ); + cfg.setSiteConfig(siteConfig); // ensure we have two tservers if (cfg.getNumTservers() < 2) { cfg.setNumTservers(2); @@ -130,10 +130,10 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterIT { log.debug("waiting for balancing, up to ~5 minutes to allow for migration cleanup."); final long startTime = System.currentTimeMillis(); - long currentWait = 10*1000; + long currentWait = 10 * 1000; boolean balancingWorked = false; - while (!balancingWorked && (System.currentTimeMillis() - startTime) < ((5*60 + 15)*1000)) { + while (!balancingWorked && (System.currentTimeMillis() - startTime) < ((5 * 60 + 15) * 1000)) { Thread.sleep(currentWait); currentWait *= 2; @@ -167,7 +167,7 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterIT { long[] tabletsPerServer = new long[stats.getTServerInfoSize()]; Arrays.fill(tabletsPerServer, 0l); for (int i = 0; i < stats.getTServerInfoSize(); i++) { - for (Map.Entry<String, TableInfo> entry : stats.getTServerInfo().get(i).getTableMap().entrySet()) { + for (Map.Entry<String,TableInfo> entry : stats.getTServerInfo().get(i).getTableMap().entrySet()) { tabletsPerServer[i] += entry.getValue().getTablets(); } } @@ -176,7 +176,7 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterIT { log.debug("We should have > 10 tablets. sleeping for " + currentWait + "ms"); continue; } - if ((NumberUtils.min(tabletsPerServer) / ((double)NumberUtils.max(tabletsPerServer))) < 0.5) { + if ((NumberUtils.min(tabletsPerServer) / ((double) NumberUtils.max(tabletsPerServer))) < 0.5) { log.debug("ratio of min to max tablets per server should be roughly even. sleeping for " + currentWait + "ms"); continue; } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/BinaryStressIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BinaryStressIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BinaryStressIT.java index 29f1f57..5a41d32 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BinaryStressIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BinaryStressIT.java @@ -54,7 +54,7 @@ public class BinaryStressIT extends AccumuloClusterIT { Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_MAXMEM.getKey(), "50K"); siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "0"); - cfg.setSiteConfig(siteConfig ); + cfg.setSiteConfig(siteConfig); } private String majcDelay, maxMem; @@ -83,7 +83,7 @@ public class BinaryStressIT extends AccumuloClusterIT { InstanceOperations iops = getConnector().instanceOperations(); iops.setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay); iops.setProperty(Property.TSERV_MAXMEM.getKey(), maxMem); - + getClusterControl().stopAllServers(ServerType.TABLET_SERVER); getClusterControl().startAllServers(ServerType.TABLET_SERVER); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java index 3319247..a4ed85d 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BloomFilterIT.java @@ -57,9 +57,9 @@ public class BloomFilterIT extends AccumuloClusterIT { public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setDefaultMemory(1, MemoryUnit.GIGABYTE); cfg.setNumTservers(1); - Map<String,String> siteConfig = new HashMap<String, String>(); + Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(), "10M"); - cfg.setSiteConfig(siteConfig ); + cfg.setSiteConfig(siteConfig); } @Override @@ -161,7 +161,7 @@ public class BloomFilterIT extends AccumuloClusterIT { private void timeCheck(long t1, long t2) throws Exception { double improvement = (t1 - t2) * 1.0 / t1; if (improvement < .1) { - throw new Exception("Queries had less than 10% improvement (old: " + t1 + " new: " + t2 + " improvement: " + (improvement*100) + "%)"); + throw new Exception("Queries had less than 10% improvement (old: " + t1 + " new: " + t2 + " improvement: " + (improvement * 100) + "%)"); } log.info(String.format("Improvement: %.2f%% (%d vs %d)", (improvement * 100), t1, t2)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java index 7d4b226..39299da 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/BulkIT.java @@ -74,7 +74,7 @@ public class BulkIT extends AccumuloIT { cluster = harness.create(getToken()); cluster.start(); } - + @After public void stopMiniCluster() throws Exception { cluster.stop(); @@ -85,8 +85,8 @@ public class BulkIT extends AccumuloIT { runTest(getConnector(), getUniqueNames(1)[0], this.getClass().getName(), testName.getMethodName()); } - static void runTest(Connector c, String tableName, String filePrefix, String dirSuffix) throws AccumuloException, AccumuloSecurityException, TableExistsException, IOException, TableNotFoundException, - MutationsRejectedException { + static void runTest(Connector c, String tableName, String filePrefix, String dirSuffix) throws AccumuloException, AccumuloSecurityException, + TableExistsException, IOException, TableNotFoundException, MutationsRejectedException { c.tableOperations().create(tableName); FileSystem fs = FileSystem.get(CachedConfiguration.getInstance()); String base = "target/accumulo-maven-plugin"; @@ -101,7 +101,7 @@ public class BulkIT extends AccumuloIT { opts.instance = c.getInstance().getInstanceName(); opts.cols = 1; opts.setTableName(tableName); - String fileFormat = "/testrf/"+filePrefix+"rf%02d"; + String fileFormat = "/testrf/" + filePrefix + "rf%02d"; for (int i = 0; i < COUNT; i++) { opts.outputFile = base + String.format(fileFormat, i); opts.startRow = N * i; http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java index 8ffdbd2..e80f823 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java @@ -38,10 +38,10 @@ public class ChaoticBalancerIT extends AccumuloClusterIT { @Override public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map<String,String> siteConfig = new HashMap<String, String>(); + Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_MAXMEM.getKey(), "10K"); siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "0"); - cfg.setSiteConfig(siteConfig ); + cfg.setSiteConfig(siteConfig); } @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java index 68911ca..2de5eda 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteEverythingIT.java @@ -17,7 +17,7 @@ package org.apache.accumulo.test.functional; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import java.util.Collections; http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java index 155c865..bc0503f 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java @@ -52,7 +52,7 @@ public class DeleteTableDuringSplitIT extends AccumuloClusterIT { } final SortedSet<Text> splits = new TreeSet<Text>(); for (byte i = 0; i < 100; i++) { - splits.add(new Text(new byte[]{0, 0, i})); + splits.add(new Text(new byte[] {0, 0, i})); } List<Future<?>> results = new ArrayList<Future<?>>(); @@ -65,8 +65,7 @@ public class DeleteTableDuringSplitIT extends AccumuloClusterIT { public void run() { try { getConnector().tableOperations().addSplits(finalName, splits); - } catch (TableNotFoundException ex) { - } catch (Exception ex) { + } catch (TableNotFoundException ex) {} catch (Exception ex) { throw new RuntimeException(finalName, ex); } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/DeletedTablesDontFlushIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeletedTablesDontFlushIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeletedTablesDontFlushIT.java index 97c696e..292ad63 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/DeletedTablesDontFlushIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/DeletedTablesDontFlushIT.java @@ -45,7 +45,7 @@ public class DeletedTablesDontFlushIT extends SharedMiniClusterIT { Mutation m = new Mutation("xyzzy"); for (int i = 0; i < 100; i++) { - m.put("cf", "" + i, new Value(new byte[]{})); + m.put("cf", "" + i, new Value(new byte[] {})); } BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig()); bw.addMutation(m); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/DurabilityIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DurabilityIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DurabilityIT.java index 9c68f5f..7507290 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/DurabilityIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/DurabilityIT.java @@ -81,13 +81,17 @@ public class DurabilityIT extends ConfigurableMacIT { TableOperations tableOps = getConnector().tableOperations(); String tableNames[] = init(); // write some gunk, delete the table to keep that table from messing with the performance numbers of successive calls - long t0 = writeSome(tableNames[0], N); tableOps.delete(tableNames[0]); - long t1 = writeSome(tableNames[1], N); tableOps.delete(tableNames[1]); - long t2 = writeSome(tableNames[2], N); tableOps.delete(tableNames[2]); - long t3 = writeSome(tableNames[3], N); tableOps.delete(tableNames[3]); + long t0 = writeSome(tableNames[0], N); + tableOps.delete(tableNames[0]); + long t1 = writeSome(tableNames[1], N); + tableOps.delete(tableNames[1]); + long t2 = writeSome(tableNames[2], N); + tableOps.delete(tableNames[2]); + long t3 = writeSome(tableNames[3], N); + tableOps.delete(tableNames[3]); System.out.println(String.format("sync %d flush %d log %d none %d", t0, t1, t2, t3)); - assertTrue("flush-only should be faster than sync", t0 > t1); - assertTrue("sync should be faster than log", t1 > t2); + assertTrue("flush-only should be faster than sync", t0 > t1); + assertTrue("sync should be faster than log", t1 > t2); assertTrue("no durability should be faster than log", t2 > t3); } @@ -147,8 +151,8 @@ public class DurabilityIT extends ConfigurableMacIT { assertTrue(N == readSome(tableName)); } - private static Map<String, String> map(Iterable<Entry<String, String>> entries) { - Map<String, String> result = new HashMap<String,String>(); + private static Map<String,String> map(Iterable<Entry<String,String>> entries) { + Map<String,String> result = new HashMap<String,String>(); for (Entry<String,String> entry : entries) { result.put(entry.getKey(), entry.getValue()); } @@ -160,7 +164,7 @@ public class DurabilityIT extends ConfigurableMacIT { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; c.instanceOperations().setProperty(Property.TABLE_DURABILITY.getKey(), "none"); - Map<String, String> props = map(c.tableOperations().getProperties(MetadataTable.NAME)); + Map<String,String> props = map(c.tableOperations().getProperties(MetadataTable.NAME)); assertEquals("sync", props.get(Property.TABLE_DURABILITY.getKey())); c.tableOperations().create(tableName); props = map(c.tableOperations().getProperties(tableName)); @@ -188,13 +192,13 @@ public class DurabilityIT extends ConfigurableMacIT { Mutation m = new Mutation("" + i); m.put("", "", ""); bw.addMutation(m); - if (i % (Math.max(1, count/100)) == 0) { + if (i % (Math.max(1, count / 100)) == 0) { bw.flush(); } } bw.close(); long result = System.currentTimeMillis() - now; - //c.tableOperations().flush(table, null, null, true); + // c.tableOperations().flush(table, null, null, true); return result; } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java index b47c9ca..6a3e7d1 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ExamplesIT.java @@ -203,11 +203,8 @@ public class ExamplesIT extends AccumuloClusterIT { new String[] {"-i", instance, "-z", keepers, "-u", user, "-p", passwd, "--dirTable", dirTable, "--indexTable", indexTable, "--dataTable", dataTable, "--vis", visibility, "--chunkSize", Integer.toString(10000), getUsableDir()}); assertEquals("Got non-zero return code. Stdout=" + entry.getValue(), 0, entry.getKey().intValue()); - entry = getClusterControl() - .execWithStdout( - QueryUtil.class, - new String[] {"-i", instance, "-z", keepers, "-p", passwd, "-u", user, "-t", indexTable, "--auths", auths, "--search", "--path", - "accumulo-site.xml"}); + entry = getClusterControl().execWithStdout(QueryUtil.class, + new String[] {"-i", instance, "-z", keepers, "-p", passwd, "-u", user, "-t", indexTable, "--auths", auths, "--search", "--path", "accumulo-site.xml"}); if (ClusterType.MINI == getClusterType()) { MiniAccumuloClusterImpl impl = (MiniAccumuloClusterImpl) cluster; for (LogWriter writer : impl.getLogWriters()) { @@ -360,8 +357,7 @@ public class ExamplesIT extends AccumuloClusterIT { @Test public void testTeraSortAndRead() throws Exception { String tableName = getUniqueNames(1)[0]; - goodExec(TeraSortIngest.class, "--count", (1000 * 1000) + "", "-nk", "10", "-xk", "10", "-nv", "10", "-xv", "10", "-t", tableName, "-i", instance, - "-z", + goodExec(TeraSortIngest.class, "--count", (1000 * 1000) + "", "-nk", "10", "-xk", "10", "-nv", "10", "-xv", "10", "-t", tableName, "-i", instance, "-z", keepers, "-u", user, "-p", passwd, "--splits", "4"); Path output = new Path(dir, "tmp/nines"); if (fs.exists(output)) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java b/test/src/test/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java index e4e7229..5f59a19 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java @@ -16,6 +16,8 @@ */ package org.apache.accumulo.test.functional; +import static org.junit.Assert.assertFalse; + import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -47,8 +49,6 @@ import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; -import static org.junit.Assert.assertFalse; - public class FunctionalTestUtils { public static int countRFiles(Connector c, String tableName) throws Exception { @@ -182,7 +182,8 @@ public class FunctionalTestUtils { public static int count(Iterable<?> i) { int count = 0; - for (@SuppressWarnings("unused") Object entry : i) + for (@SuppressWarnings("unused") + Object entry : i) count++; return count; } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java index 0315891..a7b65cd 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java @@ -102,9 +102,9 @@ public class HalfDeadTServerIT extends ConfigurableMacIT { public void testTimeout() throws Exception { String results = test(20, true); if (results != null) { - if (!results.contains("Session expired")) { + if (!results.contains("Session expired")) { log.info("Failed to find 'Session expired' in output, but TServer did die which is expected"); - } + } } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java index abc8182..7b8cb2b 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/LateLastContactIT.java @@ -26,11 +26,10 @@ import org.apache.hadoop.conf.Configuration; import org.junit.Test; /** - * Fake the "tablet stops talking but holds its lock" problem we see when hard drives and NFS fail. - * Start a ZombieTServer, and see that master stops it. + * Fake the "tablet stops talking but holds its lock" problem we see when hard drives and NFS fail. Start a ZombieTServer, and see that master stops it. */ public class LateLastContactIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setSiteConfig(Collections.singletonMap(Property.GENERAL_RPC_TIMEOUT.getKey(), "2s")); @@ -46,5 +45,5 @@ public class LateLastContactIT extends ConfigurableMacIT { Process zombie = cluster.exec(ZombieTServer.class); assertEquals(0, zombie.waitFor()); } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/LogicalTimeIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/LogicalTimeIT.java b/test/src/test/java/org/apache/accumulo/test/functional/LogicalTimeIT.java index 6076868..ca0c62a 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/LogicalTimeIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/LogicalTimeIT.java @@ -69,7 +69,8 @@ public class LogicalTimeIT extends AccumuloClusterIT { } - private void runMergeTest(Connector conn, String table, String[] splits, String[] inserts, String start, String end, String last, long expected) throws Exception { + private void runMergeTest(Connector conn, String table, String[] splits, String[] inserts, String start, String end, String last, long expected) + throws Exception { log.info("table " + table); conn.tableOperations().create(table, new NewTableConfiguration().setTimeType(TimeType.LOGICAL)); TreeSet<Text> splitSet = new TreeSet<Text>(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java index 729ec46..27c4010 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/MaxOpenIT.java @@ -48,7 +48,7 @@ public class MaxOpenIT extends AccumuloClusterIT { @Override public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map<String, String> conf = new HashMap<String, String>(); + Map<String,String> conf = new HashMap<String,String>(); conf.put(Property.TSERV_SCAN_MAX_OPENFILES.getKey(), "4"); conf.put(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "1"); conf.put(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey(), "2"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java index ed08cad..19977d3 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/MetadataMaxFilesIT.java @@ -46,7 +46,7 @@ import org.apache.hadoop.io.Text; import org.junit.Test; public class MetadataMaxFilesIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { Map<String,String> siteConfig = new HashMap<String,String>(); @@ -55,7 +55,7 @@ public class MetadataMaxFilesIT extends ConfigurableMacIT { cfg.setSiteConfig(siteConfig); hadoopCoreSite.set("fs.file.impl", RawLocalFileSystem.class.getName()); } - + @Override protected int defaultTimeoutSeconds() { return 4 * 60; @@ -85,9 +85,9 @@ public class MetadataMaxFilesIT extends ConfigurableMacIT { cluster.stop(); log.info("starting up"); cluster.start(); - + UtilWaitThread.sleep(30 * 1000); - + while (true) { MasterMonitorInfo stats = null; Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java index e0c8d0e..3930cda 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/MetadataSplitIT.java @@ -30,12 +30,12 @@ import org.apache.hadoop.conf.Configuration; import org.junit.Test; public class MetadataSplitIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setSiteConfig(Collections.singletonMap(Property.TSERV_MAJC_DELAY.getKey(), "100ms")); } - + @Override protected int defaultTimeoutSeconds() { return 2 * 60; @@ -50,7 +50,7 @@ public class MetadataSplitIT extends ConfigurableMacIT { c.tableOperations().create("table" + i); c.tableOperations().flush(MetadataTable.NAME, null, null, true); } - UtilWaitThread.sleep(10*1000); + UtilWaitThread.sleep(10 * 1000); assertTrue(c.tableOperations().listSplits(MetadataTable.NAME).size() > 2); } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java index 803c6c3..cb87946 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/MonitorLoggingIT.java @@ -94,8 +94,8 @@ public class MonitorLoggingIT extends ConfigurableMacIT { } String result = ""; - while(true) { - Thread.sleep(LOCATION_DELAY_SECS * 1000); // extra precaution to ensure monitor has opportunity to log + while (true) { + Thread.sleep(LOCATION_DELAY_SECS * 1000); // extra precaution to ensure monitor has opportunity to log // Verify messages were received at the monitor. URL url = new URL("http://" + monitorLocation + "/log"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java index f4101de..9175379 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/NativeMapIT.java @@ -319,7 +319,7 @@ public class NativeMapIT { tm.put(new Key(new Text("foo")), new Value(new byte[] {'1'})); tm.put(new Key(new Text("foo1")), new Value(new byte[] {'2'})); tm.put(new Key(new Text("foo2")), new Value(new byte[] {'3'})); - + for (Entry<Key,Value> entry : tm.entrySet()) { nm.put(entry.getKey(), entry.getValue()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java index b2ee4ce..5edc137 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RecoveryWithEmptyRFileIT.java @@ -39,16 +39,12 @@ import org.apache.log4j.Logger; import org.junit.Test; /** - XXX As a part of verifying lossy recovery via inserting an empty rfile, - this test deletes test table tablets. This will require write access to - the backing files of the test Accumulo mini cluster. - - This test should read the file location from the test harness and that - file should be on the local filesystem. If you want to take a paranoid - approach just make sure the test user doesn't have write access to the - HDFS files of any colocated live Accumulo instance or any important - local filesystem files.. -*/ + * XXX As a part of verifying lossy recovery via inserting an empty rfile, this test deletes test table tablets. This will require write access to the backing + * files of the test Accumulo mini cluster. + * + * This test should read the file location from the test harness and that file should be on the local filesystem. If you want to take a paranoid approach just + * make sure the test user doesn't have write access to the HDFS files of any colocated live Accumulo instance or any important local filesystem files.. + */ public class RecoveryWithEmptyRFileIT extends ConfigurableMacIT { private static final Logger log = Logger.getLogger(RecoveryWithEmptyRFileIT.class); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java index f4ff912..253a59c 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java @@ -110,8 +110,8 @@ public class RestartStressIT extends AccumuloClusterIT { public Integer call() { try { return control.exec(TestIngest.class, - new String[] {"-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), - "--rows", "" + IOPTS.rows, "--table", tableName}); + new String[] {"-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-i", cluster.getInstanceName(), "-z", + cluster.getZooKeepers(), "--rows", "" + IOPTS.rows, "--table", tableName}); } catch (Exception e) { log.error("Error running TestIngest", e); return -1; http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/RowDeleteIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RowDeleteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RowDeleteIT.java index bb681c0..b43a92a 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RowDeleteIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RowDeleteIT.java @@ -58,9 +58,9 @@ public class RowDeleteIT extends AccumuloClusterIT { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); - Map<String,Set<Text>> groups = new HashMap<String, Set<Text>>(); + Map<String,Set<Text>> groups = new HashMap<String,Set<Text>>(); groups.put("lg1", Collections.singleton(new Text("foo"))); - groups.put("dg", Collections.<Text>emptySet()); + groups.put("dg", Collections.<Text> emptySet()); c.tableOperations().setLocalityGroups(tableName, groups); IteratorSetting setting = new IteratorSetting(30, RowDeletingIterator.class); c.tableOperations().attachIterator(tableName, setting, EnumSet.of(IteratorScope.majc)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java index fe2e8cb..de4a47e 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ScanIdIT.java @@ -16,6 +16,10 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.util.EnumSet; import java.util.HashSet; import java.util.List; @@ -52,17 +56,13 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.google.common.base.Charsets.UTF_8; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * 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.<p> + * returns a unique scan id. + * <p> * <p/> - * The test uses the Minicluster and the {@code org.apache.accumulo.test.functional.SlowIterator} to create multiple scan sessions. - * The test exercises multiple tablet servers with splits and multiple ranges to force the scans to occur across multiple tablet servers - * for completeness. + * The test uses the Minicluster and the {@code org.apache.accumulo.test.functional.SlowIterator} to create multiple scan sessions. The test exercises multiple + * tablet servers with splits and multiple ranges to force the scans to occur across multiple tablet servers for completeness. * <p/> * This patch modified thrift, the TraceRepoDeserializationTest test seems to fail unless the following be added: * <p/> @@ -92,7 +92,8 @@ public class ScanIdIT extends AccumuloClusterIT { } /** - * @throws Exception any exception is a test failure. + * @throws Exception + * any exception is a test failure. */ @Test public void testScanId() throws Exception { @@ -174,15 +175,14 @@ public class ScanIdIT extends AccumuloClusterIT { } /** - * execute the scan across the sample data and put scan result into result map until - * testInProgress flag is set to false. + * execute the scan across the sample data and put scan result into result map until testInProgress flag is set to false. */ - @Override public void run() { + @Override + public void run() { /* - * set random initial delay of up to to - * allow scanners to proceed to different points. - */ + * set random initial delay of up to to allow scanners to proceed to different points. + */ long delay = random.nextInt(5000); @@ -245,10 +245,10 @@ public class ScanIdIT extends AccumuloClusterIT { } /** - * Create splits on table and force migration by taking table offline and then bring back - * online for test. + * Create splits on table and force migration by taking table offline and then bring back online for test. * - * @param conn Accumulo connector Accumulo connector to test cluster or MAC instance. + * @param conn + * Accumulo connector Accumulo connector to test cluster or MAC instance. */ private void addSplits(final Connector conn, final String tableName) { @@ -296,11 +296,11 @@ public class ScanIdIT extends AccumuloClusterIT { /** * Generate some sample data using random row id to distribute across splits. * <p/> - * The primary goal is to determine that each scanner is assigned a unique scan id. - * This test does check that the count value for fam1 increases if a scanner reads multiple value, but this is - * secondary consideration for this test, that is included for completeness. + * The primary goal is to determine that each scanner is assigned a unique scan id. This test does check that the count value for fam1 increases if a scanner + * reads multiple value, but this is secondary consideration for this test, that is included for completeness. * - * @param connector Accumulo connector Accumulo connector to test cluster or MAC instance. + * @param connector + * Accumulo connector Accumulo connector to test cluster or MAC instance. */ private void generateSampleData(Connector connector, final String tablename) { @@ -333,11 +333,11 @@ public class ScanIdIT extends AccumuloClusterIT { } /** - * Attach the test slow iterator so that we have time to read the scan id without creating a large dataset. Uses a - * fairly large sleep and delay times because we are not concerned with how much data is read and we do not read - * all of the data - the test stops once each scanner reports a scan id. + * Attach the test slow iterator so that we have time to read the scan id without creating a large dataset. Uses a fairly large sleep and delay times because + * we are not concerned with how much data is read and we do not read all of the data - the test stops once each scanner reports a scan id. * - * @param connector Accumulo connector Accumulo connector to test cluster or MAC instance. + * @param connector + * Accumulo connector Accumulo connector to test cluster or MAC instance. */ private void attachSlowIterator(Connector connector, final String tablename) { try { http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java index 58e6007..f0df2d0 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/SessionDurabilityIT.java @@ -135,7 +135,7 @@ public class SessionDurabilityIT extends ConfigurableMacIT { Connector c = getConnector(); ConditionalWriter cw = c.createConditionalWriter(tableName, cfg); for (int i = 0; i < n; i++) { - ConditionalMutation m = new ConditionalMutation((CharSequence)(i + ""), new Condition("", "")); + ConditionalMutation m = new ConditionalMutation((CharSequence) (i + ""), new Condition("", "")); m.put("", "", "X"); assertEquals(Status.ACCEPTED, cw.write(m).getStatus()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java index 1b9aa21..c3042d7 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ShutdownIT.java @@ -41,7 +41,8 @@ public class ShutdownIT extends ConfigurableMacIT { @Test public void shutdownDuringIngest() throws Exception { - Process ingest = cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable"); + Process ingest = cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, + "--createTable"); UtilWaitThread.sleep(100); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); ingest.destroy(); @@ -49,7 +50,9 @@ public class ShutdownIT extends ConfigurableMacIT { @Test public void shutdownDuringQuery() throws Exception { - assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root","-p", ROOT_PASSWORD, "--createTable").waitFor()); + assertEquals(0, + 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); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); @@ -58,18 +61,19 @@ public class ShutdownIT extends ConfigurableMacIT { @Test public void shutdownDuringDelete() throws Exception { - assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable").waitFor()); + assertEquals(0, + 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); assertEquals(0, cluster.exec(Admin.class, "stopAll").waitFor()); deleter.destroy(); } - @Test public void shutdownDuringDeleteTable() throws Exception { final Connector c = getConnector(); - for (int i = 0; i < 10 ; i++) { + for (int i = 0; i < 10; i++) { c.tableOperations().create("table" + i); } final AtomicReference<Exception> ref = new AtomicReference<Exception>(); @@ -102,7 +106,9 @@ public class ShutdownIT extends ConfigurableMacIT { } static void runAdminStopTest(Connector c, MiniAccumuloClusterImpl cluster) throws InterruptedException, IOException { - assertEquals(0, cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable").waitFor()); + assertEquals(0, + cluster.exec(TestIngest.class, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-u", "root", "-p", ROOT_PASSWORD, "--createTable") + .waitFor()); List<String> tabletServers = c.instanceOperations().getTabletServers(); assertEquals(2, tabletServers.size()); String doomed = tabletServers.get(0); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java index d639090..7439e23 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java @@ -69,16 +69,16 @@ import org.apache.hadoop.io.Text; import org.junit.Test; public class SplitRecoveryIT extends ConfigurableMacIT { - + @Override protected int defaultTimeoutSeconds() { return 60; } - + private KeyExtent nke(String table, String endRow, String prevEndRow) { return new KeyExtent(new Text(table), endRow == null ? null : new Text(endRow), prevEndRow == null ? null : new Text(prevEndRow)); } - + private void run() throws Exception { Instance inst = HdfsZooInstance.getInstance(); AccumuloServerContext c = new AccumuloServerContext(new ServerConfigurationFactory(inst)); @@ -87,61 +87,61 @@ public class SplitRecoveryIT extends ConfigurableMacIT { zoo.putPersistentData(zPath, new byte[0], NodeExistsPolicy.OVERWRITE); ZooLock zl = new ZooLock(zPath); boolean gotLock = zl.tryLock(new LockWatcher() { - + @Override public void lostLock(LockLossReason reason) { System.exit(-1); - + } - + @Override public void unableToMonitorLockNode(Throwable e) { System.exit(-1); } }, "foo".getBytes(UTF_8)); - + if (!gotLock) { System.err.println("Failed to get lock " + zPath); } - + // run test for a table with one tablet runSplitRecoveryTest(c, 0, "sp", 0, zl, nke("foo0", null, null)); runSplitRecoveryTest(c, 1, "sp", 0, zl, nke("foo1", null, null)); - + // run test for tables with two tablets, run test on first and last tablet runSplitRecoveryTest(c, 0, "k", 0, zl, nke("foo2", "m", null), nke("foo2", null, "m")); runSplitRecoveryTest(c, 1, "k", 0, zl, nke("foo3", "m", null), nke("foo3", null, "m")); runSplitRecoveryTest(c, 0, "o", 1, zl, nke("foo4", "m", null), nke("foo4", null, "m")); runSplitRecoveryTest(c, 1, "o", 1, zl, nke("foo5", "m", null), nke("foo5", null, "m")); - + // run test for table w/ three tablets, run test on middle tablet runSplitRecoveryTest(c, 0, "o", 1, zl, nke("foo6", "m", null), nke("foo6", "r", "m"), nke("foo6", null, "r")); runSplitRecoveryTest(c, 1, "o", 1, zl, nke("foo7", "m", null), nke("foo7", "r", "m"), nke("foo7", null, "r")); - + // run test for table w/ three tablets, run test on first runSplitRecoveryTest(c, 0, "g", 0, zl, nke("foo8", "m", null), nke("foo8", "r", "m"), nke("foo8", null, "r")); runSplitRecoveryTest(c, 1, "g", 0, zl, nke("foo9", "m", null), nke("foo9", "r", "m"), nke("foo9", null, "r")); - + // run test for table w/ three tablets, run test on last tablet runSplitRecoveryTest(c, 0, "w", 2, zl, nke("fooa", "m", null), nke("fooa", "r", "m"), nke("fooa", null, "r")); runSplitRecoveryTest(c, 1, "w", 2, zl, nke("foob", "m", null), nke("foob", "r", "m"), nke("foob", null, "r")); } - + private void runSplitRecoveryTest(AccumuloServerContext context, int failPoint, String mr, int extentToSplit, ZooLock zl, KeyExtent... extents) throws Exception { - + Text midRow = new Text(mr); - + SortedMap<FileRef,DataFileValue> splitMapFiles = null; - + for (int i = 0; i < extents.length; i++) { KeyExtent extent = extents[i]; - + String tdir = ServerConstants.getTablesDirs()[0] + "/" + extent.getTableId().toString() + "/dir_" + i; MetadataTableUtil.addTablet(extent, tdir, context, TabletTime.LOGICAL_TIME_ID, zl); SortedMap<FileRef,DataFileValue> mapFiles = new TreeMap<FileRef,DataFileValue>(); mapFiles.put(new FileRef(tdir + "/" + RFile.EXTENSION + "_000_000"), new DataFileValue(1000017 + i, 10000 + i)); - + if (i == extentToSplit) { splitMapFiles = mapFiles; } @@ -149,25 +149,25 @@ public class SplitRecoveryIT extends ConfigurableMacIT { TransactionWatcher.ZooArbitrator.start(Constants.BULK_ARBITRATOR_TYPE, tid); MetadataTableUtil.updateTabletDataFile(tid, extent, mapFiles, "L0", context, zl); } - + KeyExtent extent = extents[extentToSplit]; - + KeyExtent high = new KeyExtent(extent.getTableId(), extent.getEndRow(), midRow); KeyExtent low = new KeyExtent(extent.getTableId(), midRow, extent.getPrevEndRow()); - + splitPartiallyAndRecover(context, extent, high, low, .4, splitMapFiles, midRow, "localhost:1234", failPoint, zl); } - + private void splitPartiallyAndRecover(AccumuloServerContext context, KeyExtent extent, KeyExtent high, KeyExtent low, double splitRatio, SortedMap<FileRef,DataFileValue> mapFiles, Text midRow, String location, int steps, ZooLock zl) throws Exception { - + SortedMap<FileRef,DataFileValue> lowDatafileSizes = new TreeMap<FileRef,DataFileValue>(); SortedMap<FileRef,DataFileValue> highDatafileSizes = new TreeMap<FileRef,DataFileValue>(); List<FileRef> highDatafilesToRemove = new ArrayList<FileRef>(); - + MetadataTableUtil.splitDatafiles(extent.getTableId(), midRow, splitRatio, new HashMap<FileRef,FileUtil.FileInfo>(), mapFiles, lowDatafileSizes, highDatafileSizes, highDatafilesToRemove); - + MetadataTableUtil.splitTablet(high, extent.getPrevEndRow(), splitRatio, context, zl); TServerInstance instance = new TServerInstance(location, zl.getSessionId()); Writer writer = MetadataTableUtil.getMetadataTable(context); @@ -175,27 +175,27 @@ public class SplitRecoveryIT extends ConfigurableMacIT { Mutation m = new Mutation(assignment.tablet.getMetadataEntry()); assignment.server.putFutureLocation(m); writer.update(m); - + if (steps >= 1) { Map<FileRef,Long> bulkFiles = MetadataTableUtil.getBulkFilesLoaded(context, extent); MasterMetadataUtil.addNewTablet(context, low, "/lowDir", instance, lowDatafileSizes, bulkFiles, TabletTime.LOGICAL_TIME_ID + "0", -1l, -1l, zl); } if (steps >= 2) MetadataTableUtil.finishSplit(high, highDatafileSizes, highDatafilesToRemove, context, zl); - + TabletServer.verifyTabletInformation(context, high, instance, null, "127.0.0.1:0", zl); - + if (steps >= 1) { ensureTabletHasNoUnexpectedMetadataEntries(context, low, lowDatafileSizes); ensureTabletHasNoUnexpectedMetadataEntries(context, high, highDatafileSizes); - + Map<FileRef,Long> lowBulkFiles = MetadataTableUtil.getBulkFilesLoaded(context, low); Map<FileRef,Long> highBulkFiles = MetadataTableUtil.getBulkFilesLoaded(context, high); - + if (!lowBulkFiles.equals(highBulkFiles)) { throw new Exception(" " + lowBulkFiles + " != " + highBulkFiles + " " + low + " " + high); } - + if (lowBulkFiles.size() == 0) { throw new Exception(" no bulk files " + low); } @@ -203,62 +203,62 @@ public class SplitRecoveryIT extends ConfigurableMacIT { ensureTabletHasNoUnexpectedMetadataEntries(context, extent, mapFiles); } } - + private void ensureTabletHasNoUnexpectedMetadataEntries(AccumuloServerContext context, KeyExtent extent, SortedMap<FileRef,DataFileValue> expectedMapFiles) throws Exception { Scanner scanner = new ScannerImpl(context, MetadataTable.ID, Authorizations.EMPTY); scanner.setRange(extent.toMetadataRange()); - + HashSet<ColumnFQ> expectedColumns = new HashSet<ColumnFQ>(); expectedColumns.add(TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN); expectedColumns.add(TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN); expectedColumns.add(TabletsSection.ServerColumnFamily.TIME_COLUMN); expectedColumns.add(TabletsSection.ServerColumnFamily.LOCK_COLUMN); - + HashSet<Text> expectedColumnFamilies = new HashSet<Text>(); expectedColumnFamilies.add(DataFileColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.FutureLocationColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.CurrentLocationColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.LastLocationColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.BulkFileColumnFamily.NAME); - + Iterator<Entry<Key,Value>> iter = scanner.iterator(); while (iter.hasNext()) { Key key = iter.next().getKey(); - + if (!key.getRow().equals(extent.getMetadataEntry())) { throw new Exception("Tablet " + extent + " contained unexpected " + MetadataTable.NAME + " entry " + key); } - + if (expectedColumnFamilies.contains(key.getColumnFamily())) { continue; } - + if (expectedColumns.remove(new ColumnFQ(key))) { continue; } - + throw new Exception("Tablet " + extent + " contained unexpected " + MetadataTable.NAME + " entry " + key); } System.out.println("expectedColumns " + expectedColumns); if (expectedColumns.size() > 1 || (expectedColumns.size() == 1)) { throw new Exception("Not all expected columns seen " + extent + " " + expectedColumns); } - + SortedMap<FileRef,DataFileValue> fixedMapFiles = MetadataTableUtil.getDataFileSizes(extent, context); verifySame(expectedMapFiles, fixedMapFiles); } - + private void verifySame(SortedMap<FileRef,DataFileValue> datafileSizes, SortedMap<FileRef,DataFileValue> fixedDatafileSizes) throws Exception { - + if (!datafileSizes.keySet().containsAll(fixedDatafileSizes.keySet()) || !fixedDatafileSizes.keySet().containsAll(datafileSizes.keySet())) { throw new Exception("Key sets not the same " + datafileSizes.keySet() + " != " + fixedDatafileSizes.keySet()); } - + for (Entry<FileRef,DataFileValue> entry : datafileSizes.entrySet()) { DataFileValue dfv = entry.getValue(); DataFileValue otherDfv = fixedDatafileSizes.get(entry.getKey()); - + if (!dfv.equals(otherDfv)) { throw new Exception(entry.getKey() + " dfv not equal " + dfv + " " + otherDfv); } @@ -268,7 +268,7 @@ public class SplitRecoveryIT extends ConfigurableMacIT { public static void main(String[] args) throws Exception { new SplitRecoveryIT().run(); } - + @Test public void test() throws Exception { assertEquals(0, exec(SplitRecoveryIT.class).waitFor()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java index 1291204..bd0555b 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/WatchTheWatchCountIT.java @@ -34,7 +34,7 @@ public class WatchTheWatchCountIT extends ConfigurableMacIT { public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { cfg.setNumTservers(3); } - + @Test(timeout = 30 * 1000) public void test() throws Exception { Connector c = getConnector(); @@ -57,6 +57,5 @@ public class WatchTheWatchCountIT extends ConfigurableMacIT { socket.close(); } } - - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java index 2f41323..008476f 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/WriteAheadLogIT.java @@ -35,7 +35,7 @@ public class WriteAheadLogIT extends AccumuloClusterIT { @Override public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map<String, String> siteConfig = new HashMap<String, String>(); + Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.TSERV_WALOG_MAX_SIZE.getKey(), "2M"); siteConfig.put(Property.GC_CYCLE_DELAY.getKey(), "1"); siteConfig.put(Property.GC_CYCLE_START.getKey(), "1"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java index 9becfc2..f852901 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ZookeeperRestartIT.java @@ -41,10 +41,10 @@ import org.apache.hadoop.conf.Configuration; import org.junit.Test; public class ZookeeperRestartIT extends ConfigurableMacIT { - + @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map<String,String> siteConfig = new HashMap<String, String>(); + Map<String,String> siteConfig = new HashMap<String,String>(); siteConfig.put(Property.INSTANCE_ZK_TIMEOUT.getKey(), "3s"); cfg.setSiteConfig(siteConfig); } @@ -63,17 +63,17 @@ public class ZookeeperRestartIT extends ConfigurableMacIT { m.put("cf", "cq", "value"); bw.addMutation(m); bw.close(); - + // kill zookeeper for (ProcessReference proc : cluster.getProcesses().get(ServerType.ZOOKEEPER)) cluster.killProcess(ServerType.ZOOKEEPER, proc); - + // give the servers time to react UtilWaitThread.sleep(1000); - + // start zookeeper back up cluster.start(); - + // use the tservers Scanner s = c.createScanner("test_ingest", Authorizations.EMPTY); Iterator<Entry<Key,Value>> i = s.iterator(); @@ -83,5 +83,5 @@ public class ZookeeperRestartIT extends ConfigurableMacIT { // use the master c.tableOperations().delete("test_ingest"); } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java b/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java index 3583894..82c89be 100644 --- a/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java +++ b/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java @@ -40,23 +40,23 @@ import org.apache.hadoop.io.Text; import org.junit.Test; public class RegExTest { - + Instance inst = new MockInstance(); Connector conn; - + @Test public void runTest() throws Exception { conn = inst.getConnector("user", new PasswordToken("pass")); conn.tableOperations().create("ret"); BatchWriter bw = conn.createBatchWriter("ret", new BatchWriterConfig()); - + ArrayList<Character> chars = new ArrayList<Character>(); for (char c = 'a'; c <= 'z'; c++) chars.add(c); - + for (char c = '0'; c <= '9'; c++) chars.add(c); - + // insert some data into accumulo for (Character rc : chars) { Mutation m = new Mutation(new Text("r" + rc)); @@ -66,76 +66,76 @@ public class RegExTest { m.put(new Text("cf" + cfc), new Text("cq" + cqc), v); } } - + bw.addMutation(m); } - + bw.close(); - + runTest1(); runTest2(); runTest3(); runTest4(); runTest5(); } - + private void check(String regex, String val) throws Exception { if (regex != null && !val.matches(regex)) throw new Exception(" " + val + " does not match " + regex); } - + private void check(String regex, Text val) throws Exception { check(regex, val.toString()); } - + private void check(String regex, Value val) throws Exception { check(regex, val.toString()); } - + private void runTest1() throws Exception { // try setting all regex Range range = new Range(new Text("rf"), true, new Text("rl"), true); runTest(range, "r[g-k]", "cf[1-5]", "cq[x-z]", "v[g-k][1-5][t-y]", 5 * 5 * (3 - 1)); } - + private void runTest2() throws Exception { // try setting only a row regex Range range = new Range(new Text("rf"), true, new Text("rl"), true); runTest(range, "r[g-k]", null, null, null, 5 * 36 * 36); } - + private void runTest3() throws Exception { // try setting only a col fam regex Range range = new Range((Key) null, (Key) null); runTest(range, null, "cf[a-f]", null, null, 36 * 6 * 36); } - + private void runTest4() throws Exception { // try setting only a col qual regex Range range = new Range((Key) null, (Key) null); runTest(range, null, null, "cq[1-7]", null, 36 * 36 * 7); } - + private void runTest5() throws Exception { // try setting only a value regex Range range = new Range((Key) null, (Key) null); runTest(range, null, null, null, "v[a-c][d-f][g-i]", 3 * 3 * 3); } - + private void runTest(Range range, String rowRegEx, String cfRegEx, String cqRegEx, String valRegEx, int expected) throws Exception { - + Scanner s = conn.createScanner("ret", Authorizations.EMPTY); s.setRange(range); setRegexs(s, rowRegEx, cfRegEx, cqRegEx, valRegEx); runTest(s, rowRegEx, cfRegEx, cqRegEx, valRegEx, expected); - + BatchScanner bs = conn.createBatchScanner("ret", Authorizations.EMPTY, 1); bs.setRanges(Collections.singletonList(range)); setRegexs(bs, rowRegEx, cfRegEx, cqRegEx, valRegEx); runTest(bs, rowRegEx, cfRegEx, cqRegEx, valRegEx, expected); bs.close(); } - + private void setRegexs(ScannerBase scanner, String rowRegEx, String cfRegEx, String cqRegEx, String valRegEx) { IteratorSetting regex = new IteratorSetting(50, "regex", RegExFilter.class); if (rowRegEx != null) @@ -148,22 +148,22 @@ public class RegExTest { regex.addOption(RegExFilter.VALUE_REGEX, valRegEx); scanner.addScanIterator(regex); } - + private void runTest(Iterable<Entry<Key,Value>> scanner, String rowRegEx, String cfRegEx, String cqRegEx, String valRegEx, int expected) throws Exception { - + int counter = 0; - + for (Entry<Key,Value> entry : scanner) { Key k = entry.getKey(); - + check(rowRegEx, k.getRow()); check(cfRegEx, k.getColumnFamily()); check(cqRegEx, k.getColumnQualifier()); check(valRegEx, entry.getValue()); - + counter++; } - + if (counter != expected) { throw new Exception("scan did not return the expected number of entries " + counter + " " + expected); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java index 73c8896..f9cff98 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java @@ -151,7 +151,7 @@ public class CyclicReplicationIT { MiniAccumuloConfigImpl master1Cfg; MiniAccumuloClusterImpl master1Cluster; while (true) { - master1Cfg= new MiniAccumuloConfigImpl(master1Dir, password); + master1Cfg = new MiniAccumuloConfigImpl(master1Dir, password); master1Cfg.setNumTservers(1); master1Cfg.setInstanceName("master1"); @@ -238,13 +238,11 @@ public class CyclicReplicationIT { // Replicate master1 in the master1 cluster to master2 in the master2 cluster connMaster1.tableOperations().setProperty(master1Table, Property.TABLE_REPLICATION.getKey(), "true"); - connMaster1.tableOperations().setProperty(master1Table, - Property.TABLE_REPLICATION_TARGET.getKey() + master2Cluster.getInstanceName(), master2TableId); + connMaster1.tableOperations().setProperty(master1Table, Property.TABLE_REPLICATION_TARGET.getKey() + master2Cluster.getInstanceName(), master2TableId); // Replicate master2 in the master2 cluster to master1 in the master2 cluster connMaster2.tableOperations().setProperty(master2Table, Property.TABLE_REPLICATION.getKey(), "true"); - connMaster2.tableOperations().setProperty(master2Table, - Property.TABLE_REPLICATION_TARGET.getKey() + master1Cluster.getInstanceName(), master1TableId); + connMaster2.tableOperations().setProperty(master2Table, Property.TABLE_REPLICATION_TARGET.getKey() + master1Cluster.getInstanceName(), master1TableId); // Give our replication user the ability to write to the respective table connMaster1.securityOperations().grantTablePermission(master1UserName, master1Table, TablePermission.WRITE); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java b/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java index 9d39325..1ef47e5 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java @@ -378,7 +378,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacI bw = conn.createBatchWriter(otherTable, null); // 500k byte[] bigValue = new byte[1024 * 500]; - Arrays.fill(bigValue, (byte)1); + Arrays.fill(bigValue, (byte) 1); // 500k * 50 for (int i = 0; i < 50; i++) { Mutation m = new Mutation(Integer.toString(i)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java b/test/src/test/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java index 554b08e..6b24e99 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/MultiTserverReplicationIT.java @@ -41,7 +41,7 @@ import com.google.common.collect.Iterables; import com.google.common.net.HostAndPort; /** - * + * */ public class MultiTserverReplicationIT extends ConfigurableMacIT { private static final Logger log = LoggerFactory.getLogger(MultiTserverReplicationIT.class); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java b/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java index 145e986..6f6ab8a 100644 --- a/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java +++ b/test/src/test/java/org/apache/accumulo/test/replication/UnusedWalDoesntCloseReplicationStatusIT.java @@ -175,8 +175,7 @@ public class UnusedWalDoesntCloseReplicationStatusIT extends ConfigurableMacIT { KeyExtent extent = new KeyExtent(new Text(tableId), null, null); bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig()); m = new Mutation(extent.getMetadataEntry()); - m.put(MetadataSchema.TabletsSection.LogColumnFamily.NAME, new Text("localhost:12345/" + walUri), - new Value((walUri + "|1").getBytes(UTF_8))); + m.put(MetadataSchema.TabletsSection.LogColumnFamily.NAME, new Text("localhost:12345/" + walUri), new Value((walUri + "|1").getBytes(UTF_8))); bw.addMutation(m); // Add a replication entry for our fake WAL http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java index 552a332..395870b 100644 --- a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java +++ b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java @@ -46,8 +46,8 @@ import org.apache.accumulo.core.cli.Help; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.DefaultConfiguration; -import org.apache.accumulo.core.conf.SiteConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.conf.SiteConfiguration; import org.apache.commons.io.FileExistsException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; @@ -177,7 +177,8 @@ public class CertUtils { CertUtils certUtils = new CertUtils(opts.keystoreType, opts.issuerDirString, opts.encryptionAlg, opts.keysize, opts.signingAlg); if ("generate-all".equals(operation)) { - certUtils.createAll(new File(opts.rootKeystore), new File(opts.localKeystore), new File(opts.truststore), opts.keyNamePrefix, rootKeyPassword, keyPassword, opts.truststorePassword); + certUtils.createAll(new File(opts.rootKeystore), new File(opts.localKeystore), new File(opts.truststore), opts.keyNamePrefix, rootKeyPassword, + keyPassword, opts.truststorePassword); } else if ("generate-local".equals(operation)) { certUtils.createSignedCert(new File(opts.localKeystore), opts.keyNamePrefix + "-local", keyPassword, opts.rootKeystore, rootKeyPassword); } else if ("generate-self-trusted".equals(operation)) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/trace/src/main/java/org/apache/accumulo/trace/instrument/CloudtraceSpan.java ---------------------------------------------------------------------- diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/CloudtraceSpan.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/CloudtraceSpan.java index 3d75917..7110134 100644 --- a/trace/src/main/java/org/apache/accumulo/trace/instrument/CloudtraceSpan.java +++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/CloudtraceSpan.java @@ -24,49 +24,49 @@ import java.util.Map; @Deprecated public interface CloudtraceSpan { static final long ROOT_SPAN_ID = 0; - + /** Begin gathering timing information */ void start(); - + /** The block has completed, stop the clock */ void stop(); - + /** Get the start time, in milliseconds */ long getStartTimeMillis(); - + /** Get the stop time, in milliseconds */ long getStopTimeMillis(); - + /** Return the total amount of time elapsed since start was called, if running, or difference between stop and start */ long accumulatedMillis(); - + /** Has the span been started and not yet stopped? */ boolean running(); - + /** Return a textual description of this span */ String description(); - + /** A pseudo-unique (random) number assigned to this span instance */ long spanId(); - + /** The parent span: returns null if this is the root span */ Span parent(); - + /** A pseudo-unique (random) number assigned to the trace associated with this span */ long traceId(); - + /** Create a child span of this span with the given description */ Span child(String description); - + @Override String toString(); - + /** Return the pseudo-unique (random) number of the parent span, returns ROOT_SPAN_ID if this is the root span */ long parentId(); - + /** Add data associated with this span */ void data(String key, String value); - + /** Get data associated with this span (read only) */ Map<String,String> getData(); }