Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2520C200B5B for ; Fri, 1 Jul 2016 03:59:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 23DAA160A52; Fri, 1 Jul 2016 01:59:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C10C5160A7B for ; Fri, 1 Jul 2016 03:58:59 +0200 (CEST) Received: (qmail 71820 invoked by uid 500); 1 Jul 2016 01:58:59 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 70972 invoked by uid 99); 1 Jul 2016 01:58:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2016 01:58:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4ED90ED317; Fri, 1 Jul 2016 01:58:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Fri, 01 Jul 2016 01:59:14 -0000 Message-Id: <1a85b229e08f4c2a8f20166bf75025d6@git.apache.org> In-Reply-To: <564c5b739f274484a0df4b80e4d99b65@git.apache.org> References: <564c5b739f274484a0df4b80e4d99b65@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/32] accumulo git commit: ACCUMULO-4357 Remove unneeded code for readability archived-at: Fri, 01 Jul 2016 01:59:02 -0000 http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/examples/simple/dirlist/CountIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/examples/simple/dirlist/CountIT.java b/test/src/main/java/org/apache/accumulo/test/examples/simple/dirlist/CountIT.java index 8853733..93708a6 100644 --- a/test/src/main/java/org/apache/accumulo/test/examples/simple/dirlist/CountIT.java +++ b/test/src/main/java/org/apache/accumulo/test/examples/simple/dirlist/CountIT.java @@ -84,11 +84,11 @@ public class CountIT extends ConfigurableMacBase { FileCount fc = new FileCount(opts, scanOpts, bwOpts); fc.run(); - ArrayList> expected = new ArrayList>(); - expected.add(new Pair(QueryUtil.getRow("").toString(), "1,0,3,3")); - expected.add(new Pair(QueryUtil.getRow("/local").toString(), "2,1,2,3")); - expected.add(new Pair(QueryUtil.getRow("/local/user1").toString(), "0,2,0,2")); - expected.add(new Pair(QueryUtil.getRow("/local/user2").toString(), "0,0,0,0")); + ArrayList> expected = new ArrayList<>(); + expected.add(new Pair<>(QueryUtil.getRow("").toString(), "1,0,3,3")); + expected.add(new Pair<>(QueryUtil.getRow("/local").toString(), "2,1,2,3")); + expected.add(new Pair<>(QueryUtil.getRow("/local/user1").toString(), "0,2,0,2")); + expected.add(new Pair<>(QueryUtil.getRow("/local/user2").toString(), "0,0,0,0")); int i = 0; for (Entry e : scanner) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputFormatIT.java index 69d30af..cb53ec0 100644 --- a/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputFormatIT.java @@ -78,7 +78,7 @@ public class ChunkInputFormatIT extends AccumuloClusterHarness { public static void setupClass() { System.setProperty("hadoop.tmp.dir", System.getProperty("user.dir") + "/target/hadoop-tmp"); - data = new ArrayList>(); + data = new ArrayList<>(); ChunkInputStreamIT.addData(data, "a", "refs", "ida\0ext", "A&B", "ext"); ChunkInputStreamIT.addData(data, "a", "refs", "ida\0name", "A&B", "name"); ChunkInputStreamIT.addData(data, "a", "~chunk", 100, 0, "A&B", "asdfjkl;"); @@ -90,7 +90,7 @@ public class ChunkInputFormatIT extends AccumuloClusterHarness { ChunkInputStreamIT.addData(data, "b", "~chunk", 100, 1, "A&B", ""); ChunkInputStreamIT.addData(data, "b", "~chunk", 100, 1, "B&C", ""); ChunkInputStreamIT.addData(data, "b", "~chunk", 100, 1, "D", ""); - baddata = new ArrayList>(); + baddata = new ArrayList<>(); ChunkInputStreamIT.addData(baddata, "c", "refs", "ida\0ext", "A&B", "ext"); ChunkInputStreamIT.addData(baddata, "c", "refs", "ida\0name", "A&B", "name"); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputStreamIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputStreamIT.java b/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputStreamIT.java index 47db6dd..5b956d7 100644 --- a/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputStreamIT.java +++ b/test/src/main/java/org/apache/accumulo/test/examples/simple/filedata/ChunkInputStreamIT.java @@ -66,7 +66,7 @@ public class ChunkInputStreamIT extends AccumuloClusterHarness { @Before public void setupData() { - data = new ArrayList>(); + data = new ArrayList<>(); addData(data, "a", "refs", "id\0ext", "A&B", "ext"); addData(data, "a", "refs", "id\0name", "A&B", "name"); addData(data, "a", "~chunk", 100, 0, "A&B", "asdfjkl;"); @@ -84,7 +84,7 @@ public class ChunkInputStreamIT extends AccumuloClusterHarness { addData(data, "d", "~chunk", 100, 0, "A&B", ""); addData(data, "e", "~chunk", 100, 0, "A&B", "asdfjkl;"); addData(data, "e", "~chunk", 100, 1, "A&B", ""); - baddata = new ArrayList>(); + baddata = new ArrayList<>(); addData(baddata, "a", "~chunk", 100, 0, "A", "asdfjkl;"); addData(baddata, "b", "~chunk", 100, 0, "B", "asdfjkl;"); addData(baddata, "b", "~chunk", 100, 2, "C", ""); @@ -98,7 +98,7 @@ public class ChunkInputStreamIT extends AccumuloClusterHarness { addData(baddata, "e", "~chunk", 100, 2, "I", "asdfjkl;"); addData(baddata, "f", "~chunk", 100, 2, "K", "asdfjkl;"); addData(baddata, "g", "~chunk", 100, 0, "L", ""); - multidata = new ArrayList>(); + multidata = new ArrayList<>(); addData(multidata, "a", "~chunk", 100, 0, "A&B", "asdfjkl;"); addData(multidata, "a", "~chunk", 100, 1, "A&B", ""); addData(multidata, "a", "~chunk", 200, 0, "B&C", "asdfjkl;"); @@ -137,7 +137,7 @@ public class ChunkInputStreamIT extends AccumuloClusterHarness { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[20]; int read; - PeekingIterator> pi = new PeekingIterator>(scan.iterator()); + PeekingIterator> pi = new PeekingIterator<>(scan.iterator()); cis.setSource(pi); assertEquals(read = cis.read(b), 8); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 ddaca1e..0558c7f 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 @@ -57,7 +57,7 @@ public class AddSplitIT extends AccumuloClusterHarness { insertData(tableName, 1l); - TreeSet splits = new TreeSet(); + TreeSet splits = new TreeSet<>(); splits.add(new Text(String.format("%09d", 333))); splits.add(new Text(String.format("%09d", 666))); @@ -67,7 +67,7 @@ public class AddSplitIT extends AccumuloClusterHarness { Collection actualSplits = c.tableOperations().listSplits(tableName); - if (!splits.equals(new TreeSet(actualSplits))) { + if (!splits.equals(new TreeSet<>(actualSplits))) { throw new Exception(splits + " != " + actualSplits); } @@ -87,7 +87,7 @@ public class AddSplitIT extends AccumuloClusterHarness { actualSplits = c.tableOperations().listSplits(tableName); - if (!splits.equals(new TreeSet(actualSplits))) { + if (!splits.equals(new TreeSet<>(actualSplits))) { throw new Exception(splits + " != " + actualSplits); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java index ae470f6..525d9f9 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BalanceAfterCommsFailureIT.java @@ -65,7 +65,7 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacBase { Connector c = this.getConnector(); c.tableOperations().create("test"); Collection tservers = getCluster().getProcesses().get(ServerType.TABLET_SERVER); - ArrayList tserverPids = new ArrayList(tservers.size()); + ArrayList tserverPids = new ArrayList<>(tservers.size()); for (ProcessReference tserver : tservers) { Process p = tserver.getProcess(); if (!p.getClass().getName().equals("java.lang.UNIXProcess")) { @@ -85,7 +85,7 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacBase { for (int pid : tserverPids) { assertEquals(0, Runtime.getRuntime().exec(new String[] {"kill", "-SIGCONT", Integer.toString(pid)}).waitFor()); } - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); 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)); } @@ -120,7 +120,7 @@ public class BalanceAfterCommsFailureIT extends ConfigurableMacBase { assertEquals("Unassigned tablets were not assigned within 30 seconds", 0, unassignedTablets); - List counts = new ArrayList(); + List counts = new ArrayList<>(); for (TabletServerStatus server : stats.tServerInfo) { int count = 0; for (TableInfo table : server.tableMap.values()) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java index 623d79b..2fe5602 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java @@ -93,7 +93,7 @@ public class BalanceInPresenceOfOfflineTableIT extends AccumuloClusterHarness { Assume.assumeTrue("Not enough tservers to run test", conn.instanceOperations().getTabletServers().size() >= 2); // set up splits - final SortedSet splits = new TreeSet(); + final SortedSet splits = new TreeSet<>(); for (int i = 0; i < NUM_SPLITS; i++) { splits.add(new Text(String.format("%08x", i * 1000))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 7d36cd2..48ce3fe 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 @@ -89,8 +89,8 @@ public class BatchScanSplitIT extends AccumuloClusterHarness { System.out.println("splits : " + splits); Random random = new Random(19011230); - HashMap expected = new HashMap(); - ArrayList ranges = new ArrayList(); + HashMap expected = new HashMap<>(); + ArrayList ranges = new ArrayList<>(); for (int i = 0; i < 100; i++) { int r = random.nextInt(numRows); Text row = new Text(String.format("%09x", r)); @@ -100,7 +100,7 @@ public class BatchScanSplitIT extends AccumuloClusterHarness { // logger.setLevel(Level.TRACE); - HashMap found = new HashMap(); + HashMap found = new HashMap<>(); for (int i = 0; i < 20; i++) { BatchScanner bs = getConnector().createBatchScanner(tableName, Authorizations.EMPTY, 4); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 967ac24..9b50306 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 @@ -180,7 +180,7 @@ public class BatchWriterFlushIT extends AccumuloClusterHarness { String tableName = tableNames[0]; c.tableOperations().create(tableName); for (int x = 0; x < NUM_THREADS; x++) { - c.tableOperations().addSplits(tableName, new TreeSet(Collections.singleton(new Text(Integer.toString(x * NUM_TO_FLUSH))))); + c.tableOperations().addSplits(tableName, new TreeSet<>(Collections.singleton(new Text(Integer.toString(x * NUM_TO_FLUSH))))); } c.instanceOperations().waitForBalance(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/BinaryIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BinaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BinaryIT.java index 85716d5..f8732d5 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BinaryIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BinaryIT.java @@ -47,7 +47,7 @@ public class BinaryIT extends AccumuloClusterHarness { String tableName = getUniqueNames(1)[0]; Connector c = getConnector(); c.tableOperations().create(tableName); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); splits.add(new Text("8")); splits.add(new Text("256")); c.tableOperations().addSplits(tableName, splits); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java index fbbe542..1c6fc9f 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java @@ -169,8 +169,8 @@ public class BloomFilterIT extends AccumuloClusterHarness { private long query(Connector c, String table, int depth, long start, long end, int num, int step) throws Exception { Random r = new Random(42); - HashSet expected = new HashSet(); - List ranges = new ArrayList(num); + HashSet expected = new HashSet<>(); + List ranges = new ArrayList<>(num); Text key = new Text(); Text row = new Text("row"), cq = new Text("cq"), cf = new Text("cf"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java index bf248e6..ec8ce2d 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkFileIT.java @@ -60,7 +60,7 @@ public class BulkFileIT extends AccumuloClusterHarness { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); for (String split : "0333 0666 0999 1333 1666".split(" ")) splits.add(new Text(split)); c.tableOperations().addSplits(tableName, splits); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 7935aa4..0988795 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 @@ -53,7 +53,7 @@ public class CacheTestReader { return; } - Map readData = new TreeMap(); + Map readData = new TreeMap<>(); for (int i = 0; i < numData; i++) { byte[] v = zc.get(rootDir + "/data" + i); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 5d05a71..50a0b0e 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 @@ -59,7 +59,7 @@ public class CacheTestWriter { zk.putPersistentData(rootDir + "/dir", new byte[0], NodeExistsPolicy.FAIL); - ArrayList children = new ArrayList(); + ArrayList children = new ArrayList<>(); Random r = new Random(); @@ -69,7 +69,7 @@ public class CacheTestWriter { // change children in dir for (int u = 0; u < r.nextInt(4) + 1; u++) { - expectedData = new TreeMap(); + expectedData = new TreeMap<>(); if (r.nextFloat() < .5) { String child = UUID.randomUUID().toString(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java index 4055c3a..21d6351 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ChaoticBalancerIT.java @@ -58,7 +58,7 @@ public class ChaoticBalancerIT extends AccumuloClusterHarness { c.tableOperations().create(tableName); c.tableOperations().setProperty(tableName, Property.TABLE_LOAD_BALANCER.getKey(), ChaoticLoadBalancer.class.getName()); c.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K"); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); for (int i = 0; i < 100; i++) { splits.add(new Text(String.format("%03d", i))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java index b3d0ab5..64cdc34 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT.java @@ -83,10 +83,10 @@ public class CloneTestIT extends AccumuloClusterHarness { BatchWriter bw = writeData(table1, c); - Map props = new HashMap(); + Map props = new HashMap<>(); props.put(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "500K"); - Set exclude = new HashSet(); + Set exclude = new HashSet<>(); exclude.add(Property.TABLE_FILE_MAX.getKey()); c.tableOperations().clone(table1, table2, true, props, exclude); @@ -101,7 +101,7 @@ public class CloneTestIT extends AccumuloClusterHarness { checkMetadata(table2, c); - HashMap tableProps = new HashMap(); + HashMap tableProps = new HashMap<>(); for (Entry prop : c.tableOperations().getProperties(table2)) { tableProps.put(prop.getKey(), prop.getValue()); } @@ -118,13 +118,13 @@ public class CloneTestIT extends AccumuloClusterHarness { private void checkData(String table2, Connector c) throws TableNotFoundException { Scanner scanner = c.createScanner(table2, Authorizations.EMPTY); - HashMap expected = new HashMap(); + HashMap expected = new HashMap<>(); expected.put("001:x", "9"); expected.put("001:y", "7"); expected.put("008:x", "3"); expected.put("008:y", "4"); - HashMap actual = new HashMap(); + HashMap actual = new HashMap<>(); for (Entry entry : scanner) actual.put(entry.getKey().getRowData().toString() + ":" + entry.getKey().getColumnQualifierData().toString(), entry.getValue().toString()); @@ -229,10 +229,10 @@ public class CloneTestIT extends AccumuloClusterHarness { BatchWriter bw = writeData(table1, c); - Map props = new HashMap(); + Map props = new HashMap<>(); props.put(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "500K"); - Set exclude = new HashSet(); + Set exclude = new HashSet<>(); exclude.add(Property.TABLE_FILE_MAX.getKey()); c.tableOperations().clone(table1, table2, true, props, exclude); @@ -260,8 +260,8 @@ public class CloneTestIT extends AccumuloClusterHarness { public void testCloneWithSplits() throws Exception { Connector conn = getConnector(); - List mutations = new ArrayList(); - TreeSet splits = new TreeSet(); + List mutations = new ArrayList<>(); + TreeSet splits = new TreeSet<>(); for (int i = 0; i < 10; i++) { splits.add(new Text(Integer.toString(i))); Mutation m = new Mutation(Integer.toString(i)); @@ -284,7 +284,7 @@ public class CloneTestIT extends AccumuloClusterHarness { conn.tableOperations().deleteRows(tables[1], new Text("4"), new Text("8")); List rows = Arrays.asList("0", "1", "2", "3", "4", "9"); - List actualRows = new ArrayList(); + List actualRows = new ArrayList<>(); for (Entry entry : conn.createScanner(tables[1], Authorizations.EMPTY)) { actualRows.add(entry.getKey().getRow().toString()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java index 84c7206..d812914 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableCompactionIT.java @@ -109,7 +109,7 @@ public class ConfigurableCompactionIT extends ConfigurableMacBase { // EfgCompactionStrat will only compact a tablet w/ end row of 'efg'. No other tablets are compacted. c.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(), "org.apache.accumulo.test.EfgCompactionStrat"); - c.tableOperations().addSplits(tableName, new TreeSet(Arrays.asList(new Text("efg")))); + c.tableOperations().addSplits(tableName, new TreeSet<>(Arrays.asList(new Text("efg")))); for (char ch = 'a'; ch < 'l'; ch++) writeFlush(c, tableName, ch + ""); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 5817b03..27d84de 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 @@ -293,7 +293,7 @@ public class ConstraintIT extends AccumuloClusterHarness { throw new Exception("Unexpected constraints"); } - HashMap expected = new HashMap(); + HashMap expected = new HashMap<>(); expected.put("org.apache.accumulo.examples.simple.constraints.NumericValueConstraint", numericErrors); expected.put("org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint", 1); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseIT.java b/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseIT.java index b2373e6..919ab30 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/CreateAndUseIT.java @@ -52,7 +52,7 @@ public class CreateAndUseIT extends AccumuloClusterHarness { @BeforeClass public static void createData() throws Exception { - splits = new TreeSet(); + splits = new TreeSet<>(); for (int i = 1; i < 256; i++) { splits.add(new Text(String.format("%08x", i << 8))); @@ -110,7 +110,7 @@ public class CreateAndUseIT extends AccumuloClusterHarness { @Test public void createTableAndBatchScan() throws Exception { - ArrayList ranges = new ArrayList(); + ArrayList ranges = new ArrayList<>(); for (int i = 1; i < 257; i++) { ranges.add(new Range(new Text(String.format("%08x", (i << 8) - 16)))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsIT.java index e4a8451..fd89caa 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/DeleteRowsIT.java @@ -54,13 +54,13 @@ public class DeleteRowsIT extends AccumuloClusterHarness { private static final int ROWS_PER_TABLET = 10; private static final String[] LETTERS = new String[] {"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"}; - static final SortedSet SPLITS = new TreeSet(); + static final SortedSet SPLITS = new TreeSet<>(); static { for (String alpha : LETTERS) { SPLITS.add(new Text(alpha)); } } - static final List ROWS = new ArrayList(Arrays.asList(LETTERS)); + static final List ROWS = new ArrayList<>(Arrays.asList(LETTERS)); static { // put data on first and last tablet ROWS.add("A"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 068000d..2a6653d 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 @@ -54,8 +54,8 @@ public class DeleteRowsSplitIT extends AccumuloClusterHarness { private static final Logger log = LoggerFactory.getLogger(DeleteRowsSplitIT.class); private static final String LETTERS = "abcdefghijklmnopqrstuvwxyz"; - static final SortedSet SPLITS = new TreeSet(); - static final List ROWS = new ArrayList(); + static final SortedSet SPLITS = new TreeSet<>(); + static final List ROWS = new ArrayList<>(); static { for (byte b : LETTERS.getBytes(UTF_8)) { SPLITS.add(new Text(new byte[] {b})); @@ -125,7 +125,7 @@ public class DeleteRowsSplitIT extends AccumuloClusterHarness { } private void generateRandomRange(Text start, Text end) { - List bunch = new ArrayList(ROWS); + List bunch = new ArrayList<>(ROWS); Collections.shuffle(bunch); if (bunch.get(0).compareTo((bunch.get(1))) < 0) { start.set(bunch.get(0)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java index d2cf873..2c34537 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/DeleteTableDuringSplitIT.java @@ -53,13 +53,13 @@ public class DeleteTableDuringSplitIT extends AccumuloClusterHarness { for (String tableName : tableNames) { getConnector().tableOperations().create(tableName); } - final SortedSet splits = new TreeSet(); + final SortedSet splits = new TreeSet<>(); for (byte i = 0; i < 100; i++) { splits.add(new Text(new byte[] {0, 0, i})); } - List> results = new ArrayList>(); - List tasks = new ArrayList(); + List> results = new ArrayList<>(); + List tasks = new ArrayList<>(); SimpleThreadPool es = new SimpleThreadPool(batchSize * 2, "concurrent-api-requests"); for (String tableName : tableNames) { final String finalName = tableName; http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java index 4078e69..00d715f 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/DurabilityIT.java @@ -174,7 +174,7 @@ public class DurabilityIT extends ConfigurableMacBase { } private static Map map(Iterable> entries) { - Map result = new HashMap(); + Map result = new HashMap<>(); for (Entry entry : entries) { result.put(entry.getKey(), entry.getValue()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/FateStarvationIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FateStarvationIT.java b/test/src/main/java/org/apache/accumulo/test/functional/FateStarvationIT.java index b75a74e..30f4476 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/FateStarvationIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/FateStarvationIT.java @@ -64,7 +64,7 @@ public class FateStarvationIT extends AccumuloClusterHarness { c.tableOperations().flush(tableName, null, null, true); - List splits = new ArrayList(TestIngest.getSplitPoints(0, 100000, 67)); + List splits = new ArrayList<>(TestIngest.getSplitPoints(0, 100000, 67)); Random rand = new Random(); for (int i = 0; i < 100; i++) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java index 02e2fdf..829293e 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java @@ -69,7 +69,7 @@ public class FunctionalTestUtils { scanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME); MetadataSchema.TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner); - HashMap tabletFileCounts = new HashMap(); + HashMap tabletFileCounts = new HashMap<>(); for (Entry entry : scanner) { @@ -177,7 +177,7 @@ public class FunctionalTestUtils { } public static SortedSet splits(String[] splits) { - SortedSet result = new TreeSet(); + SortedSet result = new TreeSet<>(); for (String split : splits) result.add(new Text(split)); return result; http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 f6ecf20..76a8c5d 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 @@ -123,7 +123,7 @@ public class HalfDeadTServerIT extends ConfigurableMacBase { String classpath = System.getProperty("java.class.path"); classpath = new File(cluster.getConfig().getDir(), "conf") + File.pathSeparator + classpath; String className = TabletServer.class.getName(); - ArrayList argList = new ArrayList(); + ArrayList argList = new ArrayList<>(); argList.addAll(Arrays.asList(javaBin, "-cp", classpath)); argList.addAll(Arrays.asList(Main.class.getName(), className)); ProcessBuilder builder = new ProcessBuilder(argList); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 34d11fc..160b164 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 @@ -109,7 +109,7 @@ public class LargeRowIT extends AccumuloClusterHarness { Random r = new Random(); byte rowData[] = new byte[ROW_SIZE]; r.setSeed(SEED + 1); - TreeSet splitPoints = new TreeSet(); + TreeSet splitPoints = new TreeSet<>(); for (int i = 0; i < NUM_PRE_SPLITS; i++) { r.nextBytes(rowData); TestIngest.toPrintableChars(rowData); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeIT.java index 1e7fef0..b033dbf 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/LogicalTimeIT.java @@ -74,7 +74,7 @@ public class LogicalTimeIT extends AccumuloClusterHarness { throws Exception { log.info("table " + table); conn.tableOperations().create(table, new NewTableConfiguration().setTimeType(TimeType.LOGICAL)); - TreeSet splitSet = new TreeSet(); + TreeSet splitSet = new TreeSet<>(); for (String split : splits) { splitSet.add(new Text(split)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/MaxOpenIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MaxOpenIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MaxOpenIT.java index 6f08c1f..102afaf 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/MaxOpenIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/MaxOpenIT.java @@ -118,7 +118,7 @@ public class MaxOpenIT extends AccumuloClusterHarness { FunctionalTestUtils.checkRFiles(c, tableName, NUM_TABLETS, NUM_TABLETS, i + 1, i + 1); } - List ranges = new ArrayList(NUM_TO_INGEST); + List ranges = new ArrayList<>(NUM_TO_INGEST); for (int i = 0; i < NUM_TO_INGEST; i++) { ranges.add(new Range(TestIngest.generateRow(i, 0))); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/MergeIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MergeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MergeIT.java index c5a4afb..8c20673 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/MergeIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/MergeIT.java @@ -57,7 +57,7 @@ public class MergeIT extends AccumuloClusterHarness { } SortedSet splits(String[] points) { - SortedSet result = new TreeSet(); + SortedSet result = new TreeSet<>(); for (String point : points) result.add(new Text(point)); return result; @@ -155,14 +155,14 @@ public class MergeIT extends AccumuloClusterHarness { System.out.println("Running merge test " + table + " " + Arrays.asList(splits) + " " + start + " " + end); conn.tableOperations().create(table, new NewTableConfiguration().setTimeType(TimeType.LOGICAL)); - TreeSet splitSet = new TreeSet(); + TreeSet splitSet = new TreeSet<>(); for (String split : splits) { splitSet.add(new Text(split)); } conn.tableOperations().addSplits(table, splitSet); BatchWriter bw = conn.createBatchWriter(table, null); - HashSet expected = new HashSet(); + HashSet expected = new HashSet<>(); for (String row : inserts) { Mutation m = new Mutation(row); m.put("cf", "cq", row); @@ -176,7 +176,7 @@ public class MergeIT extends AccumuloClusterHarness { Scanner scanner = conn.createScanner(table, Authorizations.EMPTY); - HashSet observed = new HashSet(); + HashSet observed = new HashSet<>(); for (Entry entry : scanner) { String row = entry.getKey().getRowData().toString(); if (!observed.add(row)) { @@ -188,8 +188,8 @@ public class MergeIT extends AccumuloClusterHarness { throw new Exception("data inconsistency " + table + " " + observed + " != " + expected); } - HashSet currentSplits = new HashSet(conn.tableOperations().listSplits(table)); - HashSet ess = new HashSet(); + HashSet currentSplits = new HashSet<>(conn.tableOperations().listSplits(table)); + HashSet ess = new HashSet<>(); for (String es : expectedSplits) { ess.add(new Text(es)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 aba0a24..883b8dc 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 @@ -71,14 +71,14 @@ public class MetadataIT extends AccumuloClusterHarness { rootScanner.setRange(MetadataSchema.TabletsSection.getRange()); rootScanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME); - Set files1 = new HashSet(); + Set files1 = new HashSet<>(); for (Entry entry : rootScanner) files1.add(entry.getKey().getColumnQualifier().toString()); c.tableOperations().create(tableNames[1]); c.tableOperations().flush(MetadataTable.NAME, null, null, true); - Set files2 = new HashSet(); + Set files2 = new HashSet<>(); for (Entry entry : rootScanner) files2.add(entry.getKey().getColumnQualifier().toString()); @@ -88,7 +88,7 @@ public class MetadataIT extends AccumuloClusterHarness { c.tableOperations().compact(MetadataTable.NAME, null, null, false, true); - Set files3 = new HashSet(); + Set files3 = new HashSet<>(); for (Entry entry : rootScanner) files3.add(entry.getKey().getColumnQualifier().toString()); @@ -100,7 +100,7 @@ public class MetadataIT extends AccumuloClusterHarness { public void mergeMeta() throws Exception { Connector c = getConnector(); String[] names = getUniqueNames(5); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); for (String id : "1 2 3 4 5".split(" ")) { splits.add(new Text(id)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 3e8b421..6c4939f 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 @@ -63,7 +63,7 @@ public class MetadataMaxFilesIT extends ConfigurableMacBase { @Test public void test() throws Exception { Connector c = getConnector(); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); for (int i = 0; i < 1000; i++) { splits.add(new Text(String.format("%03d", i))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java index 9175379..2d594f5 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java @@ -313,7 +313,7 @@ public class NativeMapIT { NativeMap nm = new NativeMap(); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); tm.put(new Key(new Text("fo")), new Value(new byte[] {'0'})); tm.put(new Key(new Text("foo")), new Value(new byte[] {'1'})); @@ -451,14 +451,14 @@ public class NativeMapIT { // generate random data Random r = new Random(75); - ArrayList> testData = new ArrayList>(); + ArrayList> testData = new ArrayList<>(); for (int i = 0; i < 100000; i++) { Key k = new Key(rlrf(r, 97), rlrf(r, 13), rlrf(r, 31), rlrf(r, 11), (r.nextLong() & 0x7fffffffffffffffl), false, false); Value v = new Value(rlrf(r, 511)); - testData.add(new Pair(k, v)); + testData.add(new Pair<>(k, v)); } // insert unsorted data http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java index 8700891..2fc256b 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java @@ -126,7 +126,7 @@ public class PermissionsIT extends AccumuloClusterHarness { } static Map map(Iterable> i) { - Map result = new HashMap(); + Map result = new HashMap<>(); for (Entry e : i) { result.put(e.getKey(), e.getValue()); } @@ -609,8 +609,8 @@ public class PermissionsIT extends AccumuloClusterHarness { // test for bulk import permission would go here break; case ALTER_TABLE: - Map> groups = new HashMap>(); - groups.put("tgroup", new HashSet(Arrays.asList(new Text("t1"), new Text("t2")))); + Map> groups = new HashMap<>(); + groups.put("tgroup", new HashSet<>(Arrays.asList(new Text("t1"), new Text("t2")))); try { test_user_conn.tableOperations().setLocalityGroups(tableName, groups); throw new IllegalStateException("User should not be able to set locality groups"); @@ -668,8 +668,8 @@ public class PermissionsIT extends AccumuloClusterHarness { // test for bulk import permission would go here break; case ALTER_TABLE: - Map> groups = new HashMap>(); - groups.put("tgroup", new HashSet(Arrays.asList(new Text("t1"), new Text("t2")))); + Map> groups = new HashMap<>(); + groups.put("tgroup", new HashSet<>(Arrays.asList(new Text("t1"), new Text("t2")))); break; case DROP_TABLE: test_user_conn.tableOperations().delete(tableName); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java index 8b091ca..30200ec 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ReadWriteIT.java @@ -399,7 +399,7 @@ public class ReadWriteIT extends AccumuloClusterHarness { final Connector connector = getConnector(); final String tableName = getUniqueNames(1)[0]; connector.tableOperations().create(tableName); - Map> groups = new TreeMap>(); + Map> groups = new TreeMap<>(); groups.put("g1", Collections.singleton(t("colf"))); connector.tableOperations().setLocalityGroups(tableName, groups); ingest(connector, getCluster().getClientConfig(), getAdminPrincipal(), 2000, 1, 50, 0, tableName); @@ -473,11 +473,11 @@ public class ReadWriteIT extends AccumuloClusterHarness { } private Map> getGroups(String cfg) { - Map> groups = new TreeMap>(); + Map> groups = new TreeMap<>(); if (cfg != null) { for (String group : cfg.split(";")) { String[] parts = group.split(":"); - Set cols = new HashSet(); + Set cols = new HashSet<>(); for (String col : parts[1].split(",")) { cols.add(t(col)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteIT.java index 75c66bd..74d76b8 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/RowDeleteIT.java @@ -62,7 +62,7 @@ public class RowDeleteIT extends AccumuloClusterHarness { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); - Map> groups = new HashMap>(); + Map> groups = new HashMap<>(); groups.put("lg1", Collections.singleton(new Text("foo"))); groups.put("dg", Collections. emptySet()); c.tableOperations().setLocalityGroups(tableName, groups); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 aa25b93..748423e 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 @@ -92,7 +92,7 @@ public class ScanIdIT extends AccumuloClusterHarness { private static final AtomicBoolean testInProgress = new AtomicBoolean(true); - private static final Map resultsByWorker = new ConcurrentHashMap(); + private static final Map resultsByWorker = new ConcurrentHashMap<>(); @Override protected int defaultTimeoutSeconds() { @@ -146,7 +146,7 @@ public class ScanIdIT extends AccumuloClusterHarness { } // all scanner have reported at least 1 result, so check for unique scan ids. - Set scanIds = new HashSet(); + Set scanIds = new HashSet<>(); List tservers = conn.instanceOperations().getTabletServers(); @@ -314,7 +314,7 @@ public class ScanIdIT extends AccumuloClusterHarness { */ private SortedSet createSplits() { - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); for (int split = 0; split < 10; split++) { splits.add(new Text(Integer.toString(split))); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java index eb6b5e3..a274dec 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanIteratorIT.java @@ -135,7 +135,7 @@ public class ScanIteratorIT extends AccumuloClusterHarness { setupIter(bscanner); verify(bscanner, 1, 999); - ArrayList ranges = new ArrayList(); + ArrayList ranges = new ArrayList<>(); ranges.add(new Range(new Text(String.format("%06d", 1)))); ranges.add(new Range(new Text(String.format("%06d", 6)), new Text(String.format("%06d", 16)))); ranges.add(new Range(new Text(String.format("%06d", 20)))); @@ -144,8 +144,8 @@ public class ScanIteratorIT extends AccumuloClusterHarness { ranges.add(new Range(new Text(String.format("%06d", 501)), new Text(String.format("%06d", 504)))); ranges.add(new Range(new Text(String.format("%06d", 998)), new Text(String.format("%06d", 1000)))); - HashSet got = new HashSet(); - HashSet expected = new HashSet(); + HashSet got = new HashSet<>(); + HashSet expected = new HashSet<>(); for (int i : new int[] {1, 7, 9, 11, 13, 15, 23, 57, 59, 61, 501, 503, 999}) { expected.add(i); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java index bd7555e..7ab96c4 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java @@ -54,7 +54,7 @@ public class ScanRangeIT extends AccumuloClusterHarness { c.tableOperations().create(table1); String table2 = tableNames[1]; c.tableOperations().create(table2); - TreeSet splitRows = new TreeSet(); + TreeSet splitRows = new TreeSet<>(); int splits = 3; for (int i = (ROW_LIMIT / splits); i < ROW_LIMIT; i += (ROW_LIMIT / splits)) splitRows.add(createRow(i)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java index 05f304b..ca59041 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/SessionBlockVerifyIT.java @@ -110,7 +110,7 @@ public class SessionBlockVerifyIT extends ScanSessionTimeOutIT { final Iterator> slow = scanner.iterator(); - final List> callables = new ArrayList>(); + final List> callables = new ArrayList<>(); final CountDownLatch latch = new CountDownLatch(10); for (int i = 0; i < 10; i++) { Future callable = service.submit(new Callable() { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 9a2e42e..98e1031 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 @@ -78,7 +78,7 @@ public class ShutdownIT extends ConfigurableMacBase { for (int i = 0; i < 10; i++) { c.tableOperations().create("table" + i); } - final AtomicReference ref = new AtomicReference(); + final AtomicReference ref = new AtomicReference<>(); Thread async = new Thread() { @Override public void run() { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 45cf06d..864ba06 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 @@ -99,7 +99,7 @@ public class SimpleBalancerFairnessIT extends ConfigurableMacBase { assertEquals("Unassigned tablets were not assigned within 30 seconds", 0, unassignedTablets); // Compute online tablets per tserver - List counts = new ArrayList(); + List counts = new ArrayList<>(); for (TabletServerStatus server : stats.tServerInfo) { int count = 0; for (TableInfo table : server.tableMap.values()) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java index 80e5374..7010dc9 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/SplitRecoveryIT.java @@ -140,7 +140,7 @@ public class SplitRecoveryIT extends ConfigurableMacBase { String tdir = ServerConstants.getTablesDirs()[0] + "/" + extent.getTableId() + "/dir_" + i; MetadataTableUtil.addTablet(extent, tdir, context, TabletTime.LOGICAL_TIME_ID, zl); - SortedMap mapFiles = new TreeMap(); + SortedMap mapFiles = new TreeMap<>(); mapFiles.put(new FileRef(tdir + "/" + RFile.EXTENSION + "_000_000"), new DataFileValue(1000017 + i, 10000 + i)); if (i == extentToSplit) { @@ -162,9 +162,9 @@ public class SplitRecoveryIT extends ConfigurableMacBase { private void splitPartiallyAndRecover(AccumuloServerContext context, KeyExtent extent, KeyExtent high, KeyExtent low, double splitRatio, SortedMap mapFiles, Text midRow, String location, int steps, ZooLock zl) throws Exception { - SortedMap lowDatafileSizes = new TreeMap(); - SortedMap highDatafileSizes = new TreeMap(); - List highDatafilesToRemove = new ArrayList(); + SortedMap lowDatafileSizes = new TreeMap<>(); + SortedMap highDatafileSizes = new TreeMap<>(); + List highDatafilesToRemove = new ArrayList<>(); MetadataTableUtil.splitDatafiles(extent.getTableId(), midRow, splitRatio, new HashMap(), mapFiles, lowDatafileSizes, highDatafileSizes, highDatafilesToRemove); @@ -211,13 +211,13 @@ public class SplitRecoveryIT extends ConfigurableMacBase { try (Scanner scanner = new ScannerImpl(context, MetadataTable.ID, Authorizations.EMPTY)) { scanner.setRange(extent.toMetadataRange()); - HashSet expectedColumns = new HashSet(); + HashSet expectedColumns = new HashSet<>(); 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 expectedColumnFamilies = new HashSet(); + HashSet expectedColumnFamilies = new HashSet<>(); expectedColumnFamilies.add(DataFileColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.FutureLocationColumnFamily.NAME); expectedColumnFamilies.add(TabletsSection.CurrentLocationColumnFamily.NAME); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/TabletIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/TabletIT.java b/test/src/main/java/org/apache/accumulo/test/functional/TabletIT.java index d2b1416..8d52058 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/TabletIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/TabletIT.java @@ -68,7 +68,7 @@ public class TabletIT extends AccumuloClusterHarness { Connector connector = getConnector(); if (!readOnly) { - TreeSet keys = new TreeSet(); + TreeSet keys = new TreeSet<>(); for (int i = N / 100; i < N; i += N / 100) { keys.add(new Text(String.format("%05d", i))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java index b56b4a5..c64de25 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/TabletStateChangeIteratorIT.java @@ -172,7 +172,7 @@ public class TabletStateChangeIteratorIT extends SharedMiniClusterBase { Connector conn = getConnector(); conn.tableOperations().create(t); conn.tableOperations().online(t, true); - SortedSet partitionKeys = new TreeSet(); + SortedSet partitionKeys = new TreeSet<>(); partitionKeys.add(new Text("some split")); conn.tableOperations().addSplits(t, partitionKeys); if (!online) { @@ -199,7 +199,7 @@ public class TabletStateChangeIteratorIT extends SharedMiniClusterBase { @Override public Set onlineTabletServers() { - HashSet tservers = new HashSet(); + HashSet tservers = new HashSet<>(); for (String tserver : getConnector().instanceOperations().getTabletServers()) { try { String zPath = ZooUtil.getRoot(getConnector().getInstance()) + Constants.ZTSERVERS + "/" + tserver; @@ -214,7 +214,7 @@ public class TabletStateChangeIteratorIT extends SharedMiniClusterBase { @Override public Set onlineTables() { - HashSet onlineTables = new HashSet(getConnector().tableOperations().tableIdMap().values()); + HashSet onlineTables = new HashSet<>(getConnector().tableOperations().tableIdMap().values()); return Sets.filter(onlineTables, new Predicate() { @Override public boolean apply(String tableId) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/VisibilityIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/VisibilityIT.java b/test/src/main/java/org/apache/accumulo/test/functional/VisibilityIT.java index 3d6ad85..8285461 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/VisibilityIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/VisibilityIT.java @@ -94,7 +94,7 @@ public class VisibilityIT extends AccumuloClusterHarness { } private static SortedSet nss(String... labels) { - TreeSet ts = new TreeSet(); + TreeSet ts = new TreeSet<>(); for (String s : labels) { ts.add(s); @@ -153,7 +153,7 @@ public class VisibilityIT extends AccumuloClusterHarness { bw.addMutation(m1); bw.close(); - Map,Set> expected = new HashMap,Set>(); + Map,Set> expected = new HashMap<>(); expected.put(nss("A", "L"), nss("v5")); expected.put(nss("A", "M"), nss("v5")); @@ -184,10 +184,10 @@ public class VisibilityIT extends AccumuloClusterHarness { all.add(prefix); - TreeSet ss = new TreeSet(suffix); + TreeSet ss = new TreeSet<>(suffix); for (String s : suffix) { - TreeSet ps = new TreeSet(prefix); + TreeSet ps = new TreeSet<>(prefix); ps.add(s); ss.remove(s); @@ -196,7 +196,7 @@ public class VisibilityIT extends AccumuloClusterHarness { } private void queryData(Connector c, String tableName) throws Exception { - Map,Set> expected = new HashMap,Set>(); + Map,Set> expected = new HashMap<>(); expected.put(nss(), nss("v1")); expected.put(nss("A"), nss("v2")); expected.put(nss("A", "L"), nss("v5")); @@ -227,14 +227,14 @@ public class VisibilityIT extends AccumuloClusterHarness { c.securityOperations().changeUserAuthorizations(getAdminPrincipal(), new Authorizations(nbas(userAuths))); - ArrayList> combos = new ArrayList>(); + ArrayList> combos = new ArrayList<>(); uniqueCombos(combos, nss(), allAuths); for (Set set1 : combos) { - Set e = new TreeSet(); + Set e = new TreeSet<>(); for (Set set2 : combos) { - set2 = new HashSet(set2); + set2 = new HashSet<>(set2); set2.retainAll(userAuths); if (set1.containsAll(set2) && expected.containsKey(set2)) { @@ -300,7 +300,7 @@ public class VisibilityIT extends AccumuloClusterHarness { } private void verify(Iterator> iter, String... expected) throws Exception { - HashSet valuesSeen = new HashSet(); + HashSet valuesSeen = new HashSet<>(); while (iter.hasNext()) { Entry entry = iter.next(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 6f0bc7a..434a8f5 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 @@ -226,7 +226,7 @@ public class WALSunnyDayIT extends ConfigurableMacBase { if (TabletColumnFamily.PREV_ROW_COLUMN.hasColumns(key) && !logs.isEmpty()) { KeyExtent extent = new KeyExtent(key.getRow(), entry.getValue()); result.put(extent, logs); - logs = new ArrayList(); + logs = new ArrayList<>(); } } return result; http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/WriteLotsIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/WriteLotsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/WriteLotsIT.java index 38ea6f7..719dbdb 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/WriteLotsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/WriteLotsIT.java @@ -43,7 +43,7 @@ public class WriteLotsIT extends AccumuloClusterHarness { final Connector c = getConnector(); final String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); - final AtomicReference ref = new AtomicReference(); + final AtomicReference ref = new AtomicReference<>(); final ClientConfiguration clientConfig = getCluster().getClientConfig(); final int THREADS = 5; ThreadPoolExecutor tpe = new ThreadPoolExecutor(0, THREADS, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(THREADS)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 44f2859..6c20cda 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 @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly; import static java.nio.charset.StandardCharsets.UTF_8; import java.util.HashMap; @@ -24,7 +25,6 @@ import java.util.concurrent.TimeUnit; import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException; -import org.apache.accumulo.core.master.thrift.TableInfo; import org.apache.accumulo.core.master.thrift.TabletServerStatus; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface; @@ -51,7 +51,6 @@ 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. @@ -79,7 +78,7 @@ public class ZombieTServer { synchronized (this) { if (statusCount++ < 1) { TabletServerStatus result = new TabletServerStatus(); - result.tableMap = new HashMap(); + result.tableMap = new HashMap<>(); return result; } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java index a531ee0..aa6e7a1 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ZooCacheIT.java @@ -48,8 +48,8 @@ public class ZooCacheIT extends ConfigurableMacBase { @Test public void test() throws Exception { assertEquals(0, exec(CacheTestClean.class, pathName, testDir.getAbsolutePath()).waitFor()); - final AtomicReference ref = new AtomicReference(); - List threads = new ArrayList(); + final AtomicReference ref = new AtomicReference<>(); + List threads = new ArrayList<>(); for (int i = 0; i < 3; i++) { Thread reader = new Thread() { @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 5ece1ac..013edb0 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 @@ -46,7 +46,7 @@ public class ZookeeperRestartIT extends ConfigurableMacBase { @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - Map siteConfig = new HashMap(); + Map siteConfig = new HashMap<>(); siteConfig.put(Property.INSTANCE_ZK_TIMEOUT.getKey(), "15s"); cfg.setSiteConfig(siteConfig); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloInputFormatIT.java index c855b39..cf002dd 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloInputFormatIT.java @@ -208,7 +208,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { String table = getUniqueNames(1)[0]; Authorizations auths = new Authorizations("foo"); - Collection> fetchColumns = Collections.singleton(new Pair(new Text("foo"), new Text("bar"))); + Collection> fetchColumns = Collections.singleton(new Pair<>(new Text("foo"), new Text("bar"))); boolean isolated = true, localIters = true; Level level = Level.WARN; http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloMultiTableInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloMultiTableInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloMultiTableInputFormatIT.java index fb3177a..44ef7d1 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloMultiTableInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloMultiTableInputFormatIT.java @@ -111,7 +111,7 @@ public class AccumuloMultiTableInputFormatIT extends AccumuloClusterHarness { InputTableConfig tableConfig1 = new InputTableConfig(); InputTableConfig tableConfig2 = new InputTableConfig(); - Map configMap = new HashMap(); + Map configMap = new HashMap<>(); configMap.put(table1, tableConfig1); configMap.put(table2, tableConfig2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloRowInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloRowInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloRowInputFormatIT.java index 98978dc..e81741a 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloRowInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapred/AccumuloRowInputFormatIT.java @@ -69,13 +69,13 @@ public class AccumuloRowInputFormatIT extends AccumuloClusterHarness { @BeforeClass public static void prepareRows() { - row1 = new ArrayList>(); + row1 = new ArrayList<>(); row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes())); row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes())); row1.add(new KeyValue(new Key(ROW1, "colf2", "colq3"), "v3".getBytes())); - row2 = new ArrayList>(); + row2 = new ArrayList<>(); row2.add(new KeyValue(new Key(ROW2, COLF1, "colq4"), "v4".getBytes())); - row3 = new ArrayList>(); + row3 = new ArrayList<>(); row3.add(new KeyValue(new Key(ROW3, COLF1, "colq5"), "v5".getBytes())); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloInputFormatIT.java index 11e7d7c..a581099 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloInputFormatIT.java @@ -129,7 +129,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { AccumuloInputFormat.setConnectorInfo(job, getAdminPrincipal(), getAdminToken()); // split table - TreeSet splitsToAdd = new TreeSet(); + TreeSet splitsToAdd = new TreeSet<>(); for (int i = 0; i < 10000; i += 1000) splitsToAdd.add(new Text(String.format("%09d", i))); conn.tableOperations().addSplits(table, splitsToAdd); @@ -141,7 +141,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { assertEquals(actualSplits.size() + 1, splits.size()); // No ranges set on the job so it'll start with -inf // set ranges and get splits - List ranges = new ArrayList(); + List ranges = new ArrayList<>(); for (Text text : actualSplits) ranges.add(new Range(text)); AccumuloInputFormat.setRanges(job, ranges); @@ -160,7 +160,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { assertEquals(actualSplits.size(), splits.size()); // auto adjust ranges - ranges = new ArrayList(); + ranges = new ArrayList<>(); for (int i = 0; i < 5; i++) // overlapping ranges ranges.add(new Range(String.format("%09d", i), String.format("%09d", i + 2))); @@ -402,7 +402,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { String table = getUniqueNames(1)[0]; Authorizations auths = new Authorizations("foo"); - Collection> fetchColumns = Collections.singleton(new Pair(new Text("foo"), new Text("bar"))); + Collection> fetchColumns = Collections.singleton(new Pair<>(new Text("foo"), new Text("bar"))); boolean isolated = true, localIters = true; Level level = Level.WARN; @@ -506,7 +506,7 @@ public class AccumuloInputFormatIT extends AccumuloClusterHarness { @Override public List getSplits(JobContext context) throws IOException { List oldSplits = super.getSplits(context); - List newSplits = new ArrayList(oldSplits.size()); + List newSplits = new ArrayList<>(oldSplits.size()); // Copy only the necessary information for (InputSplit oldSplit : oldSplits) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloMultiTableInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloMultiTableInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloMultiTableInputFormatIT.java index bd7ea42..350a183 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloMultiTableInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloMultiTableInputFormatIT.java @@ -103,7 +103,7 @@ public class AccumuloMultiTableInputFormatIT extends AccumuloClusterHarness { InputTableConfig tableConfig1 = new InputTableConfig(); InputTableConfig tableConfig2 = new InputTableConfig(); - Map configMap = new HashMap(); + Map configMap = new HashMap<>(); configMap.put(table1, tableConfig1); configMap.put(table2, tableConfig2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloRowInputFormatIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloRowInputFormatIT.java b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloRowInputFormatIT.java index 1275bf9..c03d462 100644 --- a/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloRowInputFormatIT.java +++ b/test/src/main/java/org/apache/accumulo/test/mapreduce/AccumuloRowInputFormatIT.java @@ -66,13 +66,13 @@ public class AccumuloRowInputFormatIT extends AccumuloClusterHarness { @BeforeClass public static void prepareRows() { - row1 = new ArrayList>(); + row1 = new ArrayList<>(); row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes())); row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes())); row1.add(new KeyValue(new Key(ROW1, "colf2", "colq3"), "v3".getBytes())); - row2 = new ArrayList>(); + row2 = new ArrayList<>(); row2.add(new KeyValue(new Key(ROW2, COLF1, "colq4"), "v4".getBytes())); - row3 = new ArrayList>(); + row3 = new ArrayList<>(); row3.add(new KeyValue(new Key(ROW3, COLF1, "colq5"), "v5".getBytes())); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java b/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java index 6733e4b..827d6d8 100644 --- a/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java +++ b/test/src/main/java/org/apache/accumulo/test/performance/RollWALPerformanceIT.java @@ -68,7 +68,7 @@ public class RollWALPerformanceIT extends ConfigurableMacBase { log.info("Splitting the table"); final long SPLIT_COUNT = 100; final long distance = Long.MAX_VALUE / SPLIT_COUNT; - final SortedSet splits = new TreeSet(); + final SortedSet splits = new TreeSet<>(); for (int i = 1; i < SPLIT_COUNT; i++) { splits.add(new Text(String.format("%016x", i * distance))); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java index e74aa88..157d4a0 100644 --- a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java +++ b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java @@ -70,7 +70,7 @@ public class MetadataBatchScanTest { Instance inst = new ZooKeeperInstance(new ClientConfiguration().withInstance("acu14").withZkHosts("localhost")); final Connector connector = inst.getConnector(opts.getPrincipal(), opts.getToken()); - TreeSet splits = new TreeSet(); + TreeSet splits = new TreeSet<>(); Random r = new Random(42); while (splits.size() < 99999) { @@ -80,7 +80,7 @@ public class MetadataBatchScanTest { String tid = "8"; Text per = null; - ArrayList extents = new ArrayList(); + ArrayList extents = new ArrayList<>(); for (Long split : splits) { Text er = new Text(String.format("%012d", split)); @@ -128,12 +128,12 @@ public class MetadataBatchScanTest { final int numLoop = Integer.parseInt(args[2]); int numLookups = Integer.parseInt(args[3]); - HashSet indexes = new HashSet(); + HashSet indexes = new HashSet<>(); while (indexes.size() < numLookups) { indexes.add(r.nextInt(extents.size())); } - final List ranges = new ArrayList(); + final List ranges = new ArrayList<>(); for (Integer i : indexes) { ranges.add(extents.get(i).toMetadataRange()); }