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 C8C1C200BC4 for ; Fri, 4 Nov 2016 23:22:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C76CD160B04; Fri, 4 Nov 2016 22:22:49 +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 415F2160B19 for ; Fri, 4 Nov 2016 23:22:47 +0100 (CET) Received: (qmail 68172 invoked by uid 500); 4 Nov 2016 22:22:46 -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 66478 invoked by uid 99); 4 Nov 2016 22:22:43 -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, 04 Nov 2016 22:22:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D72E3F0BE6; Fri, 4 Nov 2016 22:22:43 +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, 04 Nov 2016 22:23:07 -0000 Message-Id: <6fb4210bab164575afcceed89c8b0e35@git.apache.org> In-Reply-To: <8db15481562846a5947e4d4b91c82ee1@git.apache.org> References: <8db15481562846a5947e4d4b91c82ee1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/48] accumulo git commit: ACCUMULO-4514 Remove unnecessary code archived-at: Fri, 04 Nov 2016 22:22:50 -0000 http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java index 758f718..ca10c65 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java @@ -105,7 +105,7 @@ public class TransformingIteratorTest { // the same key/value pair for every getTopKey/getTopValue call. The code // will always return the final key/value if we didn't copy the original key // in the iterator. - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int row = 1; row <= 3; ++row) { for (int cf = 1; cf <= 3; ++cf) { for (int cq = 1; cq <= 3; ++cq) { @@ -121,7 +121,7 @@ public class TransformingIteratorTest { @Test public void testNoRangeScan() throws Exception { - List> classes = new ArrayList>(); + List> classes = new ArrayList<>(); classes.add(ColFamReversingKeyTransformingIterator.class); classes.add(ColQualReversingKeyTransformingIterator.class); classes.add(ColVisReversingKeyTransformingIterator.class); @@ -133,7 +133,7 @@ public class TransformingIteratorTest { // All rows with visibilities reversed TransformingIterator iter = clazz.newInstance(); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int row = 1; row <= 3; ++row) { for (int cf = 1; cf <= 3; ++cf) { for (int cq = 1; cq <= 3; ++cq) { @@ -160,7 +160,7 @@ public class TransformingIteratorTest { // vis0. scanner.removeScanIterator("keyTransformIter"); setUpTransformIterator(ColVisReversingKeyTransformingIterator.class); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int row = 1; row <= 3; ++row) { for (int cf = 1; cf <= 3; ++cf) { for (int cq = 1; cq <= 3; ++cq) { @@ -192,7 +192,7 @@ public class TransformingIteratorTest { setUpTransformIterator(ColVisReversingKeyTransformingIterator.class); scanner.setRange(new Range(new Key("row1", "cf2", "cq2", "vis1"), true, new Key("row1", "cf2", "cq3"), false)); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); putExpected(expected, 1, 2, 2, 1, PartialKey.ROW_COLFAM_COLQUAL); // before the range start, but transforms in the range putExpected(expected, 1, 2, 2, 2, PartialKey.ROW_COLFAM_COLQUAL); @@ -204,7 +204,7 @@ public class TransformingIteratorTest { setUpTransformIterator(ColVisReversingKeyTransformingIterator.class); scanner.setRange(new Range(new Key("row1", "cf2", "cq2"), true, new Key("row1", "cf2", "cq2", "vis2"), false)); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); // putExpected(expected, 1, 2, 2, 1, part); // transforms vis outside range end putExpected(expected, 1, 2, 2, 2, PartialKey.ROW_COLFAM_COLQUAL); putExpected(expected, 1, 2, 2, 3, PartialKey.ROW_COLFAM_COLQUAL); @@ -220,7 +220,7 @@ public class TransformingIteratorTest { // be inside the range. scanner.setRange(new Range(new Key("row1", "cf0"), true, new Key("row1", "cf1"), false)); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int cq = 1; cq <= 3; ++cq) for (int cv = 1; cv <= 3; ++cv) putExpected(expected, 1, 3, cq, cv, PartialKey.ROW); @@ -268,7 +268,7 @@ public class TransformingIteratorTest { setUpTransformIterator(ColFamReversingKeyTransformingIterator.class); scanner.fetchColumnFamily(new Text("cf2")); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int row = 1; row <= 3; ++row) for (int cq = 1; cq <= 3; ++cq) for (int cv = 1; cv <= 3; ++cv) @@ -328,7 +328,7 @@ public class TransformingIteratorTest { setUpTransformIterator(ColFamReversingCompactionKeyTransformingIterator.class); scanner.fetchColumnFamily(new Text("cf2")); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int row = 1; row <= 3; ++row) for (int cq = 1; cq <= 3; ++cq) for (int cv = 1; cv <= 3; ++cv) @@ -343,7 +343,7 @@ public class TransformingIteratorTest { // should still show up. setUpTransformIterator(BadVisCompactionKeyTransformingIterator.class); - TreeMap expected = new TreeMap(); + TreeMap expected = new TreeMap<>(); for (int rowID = 1; rowID <= 3; ++rowID) { for (int cfID = 1; cfID <= 3; ++cfID) { for (int cqID = 1; cqID <= 3; ++cqID) { @@ -399,7 +399,7 @@ public class TransformingIteratorTest { TransformingIterator.setMaxBufferSize(is, 10000000); Assert.assertTrue(ti.validateOptions(is.getOptions())); - Map opts = new HashMap(); + Map opts = new HashMap<>(); opts.put(TransformingIterator.MAX_BUFFER_SIZE_OPT, "10M"); Assert.assertTrue(ti.validateOptions(is.getOptions())); @@ -571,7 +571,7 @@ public class TransformingIteratorTest { @Override protected Collection untransformColumnFamilies(Collection columnFamilies) { - HashSet untransformed = new HashSet(); + HashSet untransformed = new HashSet<>(); for (ByteSequence cf : columnFamilies) untransformed.add(untransformColumnFamily(cf)); return untransformed; http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java index fa42998..cdd0074 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java @@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory; public class VersioningIteratorTest { // add test for seek function - private static final Collection EMPTY_COL_FAMS = new ArrayList(); + private static final Collection EMPTY_COL_FAMS = new ArrayList<>(); private static final Encoder encoder = LongCombiner.FIXED_LEN_ENCODER; private static final Logger log = LoggerFactory.getLogger(VersioningIteratorTest.class); @@ -56,7 +56,7 @@ public class VersioningIteratorTest { } TreeMap iteratorOverTestData(VersioningIterator it) throws IOException { - TreeMap tmOut = new TreeMap(); + TreeMap tmOut = new TreeMap<>(); while (it.hasTop()) { tmOut.put(it.getTopKey(), it.getTopValue()); it.next(); @@ -70,7 +70,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); @@ -101,7 +101,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); @@ -137,7 +137,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); @@ -186,7 +186,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); @@ -215,7 +215,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); @@ -237,7 +237,7 @@ public class VersioningIteratorTest { Text colf = new Text("a"); Text colq = new Text("b"); - TreeMap tm = new TreeMap(); + TreeMap tm = new TreeMap<>(); createTestData(tm, colf, colq); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/iterators/user/VisibilityFilterTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/VisibilityFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/VisibilityFilterTest.java index 810c355..8de1472 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/VisibilityFilterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/VisibilityFilterTest.java @@ -39,7 +39,7 @@ import org.junit.Test; public class VisibilityFilterTest { - private static final Collection EMPTY_COL_FAMS = new ArrayList(); + private static final Collection EMPTY_COL_FAMS = new ArrayList<>(); private static final Text BAD = new Text("bad"); private static final Text GOOD = new Text("good"); @@ -50,7 +50,7 @@ public class VisibilityFilterTest { private static final Value EMPTY_VALUE = new Value(new byte[0]); private TreeMap createUnprotectedSource(int numPublic, int numHidden) { - TreeMap source = new TreeMap(); + TreeMap source = new TreeMap<>(); for (int i = 0; i < numPublic; i++) source.put(new Key(new Text(String.format("%03d", i)), GOOD, GOOD, EMPTY_VIS), EMPTY_VALUE); for (int i = 0; i < numHidden; i++) @@ -59,7 +59,7 @@ public class VisibilityFilterTest { } private TreeMap createPollutedSource(int numGood, int numBad) { - TreeMap source = new TreeMap(); + TreeMap source = new TreeMap<>(); for (int i = 0; i < numGood; i++) source.put(new Key(new Text(String.format("%03d", i)), GOOD, GOOD, GOOD_VIS), EMPTY_VALUE); for (int i = 0; i < numBad; i++) @@ -68,7 +68,7 @@ public class VisibilityFilterTest { } private TreeMap createSourceWithHiddenData(int numViewable, int numHidden) { - TreeMap source = new TreeMap(); + TreeMap source = new TreeMap<>(); for (int i = 0; i < numViewable; i++) source.put(new Key(new Text(String.format("%03d", i)), GOOD, GOOD, GOOD_VIS), EMPTY_VALUE); for (int i = 0; i < numHidden; i++) http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java index f5440cd..882c82a 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeColumnFamilyIteratorTest.java @@ -56,9 +56,9 @@ import org.junit.Assert; public class WholeColumnFamilyIteratorTest extends TestCase { public void testEmptyStuff() throws IOException { - SortedMap map = new TreeMap(); - SortedMap map2 = new TreeMap(); - final Map toInclude = new HashMap(); + SortedMap map = new TreeMap<>(); + SortedMap map2 = new TreeMap<>(); + final Map toInclude = new HashMap<>(); map.put(new Key(new Text("r1"), new Text("cf1"), new Text("cq1"), new Text("cv1"), 1l), new Value("val1".getBytes())); map.put(new Key(new Text("r1"), new Text("cf1"), new Text("cq2"), new Text("cv1"), 2l), new Value("val2".getBytes())); map.put(new Key(new Text("r2"), new Text("cf1"), new Text("cq1"), new Text("cv1"), 3l), new Value("val3".getBytes())); @@ -88,7 +88,7 @@ public class WholeColumnFamilyIteratorTest extends TestCase { } SortedMapIterator source = new SortedMapIterator(map); WholeColumnFamilyIterator iter = new WholeColumnFamilyIterator(source); - SortedMap resultMap = new TreeMap(); + SortedMap resultMap = new TreeMap<>(); iter.seek(new Range(), new ArrayList(), false); int numRows = 0; while (iter.hasTop()) { @@ -129,19 +129,19 @@ public class WholeColumnFamilyIteratorTest extends TestCase { } public void testContinue() throws Exception { - SortedMap map1 = new TreeMap(); + SortedMap map1 = new TreeMap<>(); pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo"); pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map2 = new TreeMap(); + SortedMap map2 = new TreeMap<>(); pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo"); pkv(map2, "row2", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map3 = new TreeMap(); + SortedMap map3 = new TreeMap<>(); pkv(map3, "row3", "cf1", "cq1", "cv1", 5, "foo"); pkv(map3, "row3", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map = new TreeMap(); + SortedMap map = new TreeMap<>(); map.putAll(map1); map.putAll(map2); map.putAll(map3); @@ -170,14 +170,14 @@ public class WholeColumnFamilyIteratorTest extends TestCase { } public void testBug1() throws Exception { - SortedMap map1 = new TreeMap(); + SortedMap map1 = new TreeMap<>(); pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo"); pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map2 = new TreeMap(); + SortedMap map2 = new TreeMap<>(); pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo"); - SortedMap map = new TreeMap(); + SortedMap map = new TreeMap<>(); map.putAll(map1); map.putAll(map2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java index b47ef3e..8d37d6c 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/WholeRowIteratorTest.java @@ -55,9 +55,9 @@ public class WholeRowIteratorTest { @Test public void testEmptyStuff() throws IOException { - SortedMap map = new TreeMap(); - SortedMap map2 = new TreeMap(); - final Map toInclude = new HashMap(); + SortedMap map = new TreeMap<>(); + SortedMap map2 = new TreeMap<>(); + final Map toInclude = new HashMap<>(); map.put(new Key(new Text("r1"), new Text("cf1"), new Text("cq1"), new Text("cv1"), 1l), new Value("val1".getBytes())); map.put(new Key(new Text("r1"), new Text("cf1"), new Text("cq2"), new Text("cv1"), 2l), new Value("val2".getBytes())); map.put(new Key(new Text("r2"), new Text("cf1"), new Text("cq1"), new Text("cv1"), 3l), new Value("val3".getBytes())); @@ -87,7 +87,7 @@ public class WholeRowIteratorTest { } SortedMapIterator source = new SortedMapIterator(map); WholeRowIterator iter = new WholeRowIterator(source); - SortedMap resultMap = new TreeMap(); + SortedMap resultMap = new TreeMap<>(); iter.seek(new Range(), new ArrayList(), false); int numRows = 0; while (iter.hasTop()) { @@ -126,19 +126,19 @@ public class WholeRowIteratorTest { @Test public void testContinue() throws Exception { - SortedMap map1 = new TreeMap(); + SortedMap map1 = new TreeMap<>(); pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo"); pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map2 = new TreeMap(); + SortedMap map2 = new TreeMap<>(); pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo"); pkv(map2, "row2", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map3 = new TreeMap(); + SortedMap map3 = new TreeMap<>(); pkv(map3, "row3", "cf1", "cq1", "cv1", 5, "foo"); pkv(map3, "row3", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map = new TreeMap(); + SortedMap map = new TreeMap<>(); map.putAll(map1); map.putAll(map2); map.putAll(map3); @@ -168,14 +168,14 @@ public class WholeRowIteratorTest { @Test public void testBug1() throws Exception { - SortedMap map1 = new TreeMap(); + SortedMap map1 = new TreeMap<>(); pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo"); pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar"); - SortedMap map2 = new TreeMap(); + SortedMap map2 = new TreeMap<>(); pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo"); - SortedMap map = new TreeMap(); + SortedMap map = new TreeMap<>(); map.putAll(map1); map.putAll(map2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java b/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java index 60464a6..c4c46cb 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/LocalityGroupUtilTest.java @@ -80,8 +80,8 @@ public class LocalityGroupUtilTest { assertEquals(ecf, LocalityGroupUtil.encodeColumnFamily(bs2)); // test encoding multiple column fams containing binary data - HashSet in = new HashSet(); - HashSet in2 = new HashSet(); + HashSet in = new HashSet<>(); + HashSet in2 = new HashSet<>(); in.add(new Text(test1)); in2.add(new ArrayByteSequence(test1)); in.add(new Text(test2)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java b/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java index 5b0dc55..0d84b12 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/MergeTest.java @@ -32,8 +32,8 @@ import org.junit.Test; public class MergeTest { static class MergeTester extends Merge { - public List> merges = new ArrayList>(); - public List tablets = new ArrayList(); + public List> merges = new ArrayList<>(); + public List tablets = new ArrayList<>(); MergeTester(Integer... sizes) { Text start = null; @@ -95,7 +95,7 @@ public class MergeTest { @Override protected void merge(Connector conn, String table, List sizes, int numToMerge) throws MergeException { - List merge = new ArrayList(); + List merge = new ArrayList<>(); for (int i = 0; i < numToMerge; i++) { merge.add(sizes.get(i)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/PairTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/PairTest.java b/core/src/test/java/org/apache/accumulo/core/util/PairTest.java index 60af90e..6effc9e 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/PairTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/PairTest.java @@ -30,8 +30,8 @@ public class PairTest { */ @Test public void testEqualsObject() { - Pair pair = new Pair(25, "twenty-five"); - Pair pair2 = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); + Pair pair2 = new Pair<>(25, "twenty-five"); assertEquals(pair, pair2); } @@ -40,7 +40,7 @@ public class PairTest { */ @Test public void testGetFirst() { - Pair pair = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); assertEquals((Integer) 25, pair.getFirst()); } @@ -49,7 +49,7 @@ public class PairTest { */ @Test public void testGetSecond() { - Pair pair = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); assertEquals("twenty-five", pair.getSecond()); } @@ -58,7 +58,7 @@ public class PairTest { */ @Test public void testToString() { - Pair pair = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); assertEquals("(25,twenty-five)", pair.toString()); } @@ -67,7 +67,7 @@ public class PairTest { */ @Test public void testToStringStringStringString() { - Pair pair = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); assertEquals("---25~~~twenty-five+++", pair.toString("---", "~~~", "+++")); } @@ -76,7 +76,7 @@ public class PairTest { */ @Test public void testToMapEntry() { - Pair pair = new Pair(10, "IO"); + Pair pair = new Pair<>(10, "IO"); Entry entry = pair.toMapEntry(); assertEquals(pair.getFirst(), entry.getKey()); @@ -88,9 +88,9 @@ public class PairTest { */ @Test public void testSwap() { - Pair pair = new Pair(25, "twenty-five"); + Pair pair = new Pair<>(25, "twenty-five"); assertEquals(pair, pair.swap().swap()); - Pair pair2 = new Pair("twenty-five", 25); + Pair pair2 = new Pair<>("twenty-five", 25); assertEquals(pair, pair2.swap()); assertEquals(pair2, pair.swap()); } @@ -100,7 +100,7 @@ public class PairTest { */ @Test public void testFromEntry() { - Entry entry = new SimpleImmutableEntry(10, "IO"); + Entry entry = new SimpleImmutableEntry<>(10, "IO"); Pair pair0 = Pair.fromEntry(entry); assertEquals(entry.getKey(), pair0.getFirst()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/PartitionerTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/PartitionerTest.java b/core/src/test/java/org/apache/accumulo/core/util/PartitionerTest.java index 8ab2beb..7568aba 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/PartitionerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/PartitionerTest.java @@ -112,7 +112,7 @@ public class PartitionerTest { } private Set toKeySet(Mutation... expected) { - HashSet ret = new HashSet(); + HashSet ret = new HashSet<>(); for (Mutation mutation : expected) for (ColumnUpdate cu : mutation.getUpdates()) ret.add(new Key(mutation.getRow(), cu.getColumnFamily(), cu.getColumnQualifier(), cu.getColumnVisibility(), cu.getTimestamp())); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/format/DateStringFormatterTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/DateStringFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/DateStringFormatterTest.java index 1b121f3..566853f 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/format/DateStringFormatterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/format/DateStringFormatterTest.java @@ -36,7 +36,7 @@ public class DateStringFormatterTest { @Before public void setUp() { formatter = new DateStringFormatter(); - data = new TreeMap(); + data = new TreeMap<>(); data.put(new Key("", "", "", 0), new Value()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java index 4745ad3..be09070 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/format/HexFormatterTest.java @@ -35,7 +35,7 @@ public class HexFormatterTest { @Before public void setUp() { - data = new TreeMap(); + data = new TreeMap<>(); formatter = new HexFormatter(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatterTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatterTest.java index e8879a5..9359b7f 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatterTest.java @@ -39,7 +39,7 @@ public class ShardedTableDistributionFormatterTest { @Before public void setUp() { - data = new TreeMap(); + data = new TreeMap<>(); formatter = new ShardedTableDistributionFormatter(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/core/src/test/java/org/apache/accumulo/core/util/format/StatisticsDisplayFormatterTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/StatisticsDisplayFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/StatisticsDisplayFormatterTest.java index 93c948c..fdbd11f 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/format/StatisticsDisplayFormatterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/format/StatisticsDisplayFormatterTest.java @@ -35,7 +35,7 @@ public class StatisticsDisplayFormatterTest { @Before public void setUp() { - data = new TreeMap(); + data = new TreeMap<>(); formatter = new StatisticsDisplayFormatter(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java index 4bd1e61..e762e7d 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java @@ -116,8 +116,8 @@ public class RandomBatchScanner { */ static boolean doRandomQueries(int num, long min, long max, int evs, Random r, BatchScanner tsbr) { - HashSet ranges = new HashSet(num); - HashMap expectedRows = new java.util.HashMap(); + HashSet ranges = new HashSet<>(num); + HashMap expectedRows = new java.util.HashMap<>(); generateRandomQueries(num, min, max, r, ranges, expectedRows); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java index 05a737f..abfc37d 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java @@ -143,7 +143,7 @@ public class RandomBatchWriter { ColumnVisibility cv = opts.visiblity; // Generate num unique row ids in the given range - HashSet rowids = new HashSet(opts.num); + HashSet rowids = new HashSet<>(opts.num); while (rowids.size() < opts.num) { rowids.add((abs(r.nextLong()) % (opts.max - opts.min)) + opts.min); } @@ -156,11 +156,11 @@ public class RandomBatchWriter { bw.close(); } catch (MutationsRejectedException e) { if (e.getSecurityErrorCodes().size() > 0) { - HashMap> tables = new HashMap>(); + HashMap> tables = new HashMap<>(); for (Entry> ke : e.getSecurityErrorCodes().entrySet()) { Set secCodes = tables.get(ke.getKey().getTableId().toString()); if (secCodes == null) { - secCodes = new HashSet(); + secCodes = new HashSet<>(); tables.put(ke.getKey().getTableId().toString(), secCodes); } secCodes.addAll(ke.getValue()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java index 70effb1..44d4b6f 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/ReadWriteExample.java @@ -88,7 +88,7 @@ public class ReadWriteExample { // create table if (opts.createtable) { - SortedSet partitionKeys = new TreeSet(); + SortedSet partitionKeys = new TreeSet<>(); for (int i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; i++) partitionKeys.add(new Text(new byte[] {(byte) i})); conn.tableOperations().create(opts.getTableName()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/constraints/AlphaNumKeyConstraint.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/constraints/AlphaNumKeyConstraint.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/constraints/AlphaNumKeyConstraint.java index f265e18..14e3c8e 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/constraints/AlphaNumKeyConstraint.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/constraints/AlphaNumKeyConstraint.java @@ -55,7 +55,7 @@ public class AlphaNumKeyConstraint implements Constraint { private Set addViolation(Set violations, short violation) { if (violations == null) { - violations = new LinkedHashSet(); + violations = new LinkedHashSet<>(); violations.add(violation); } else if (!violations.contains(violation)) { violations.add(violation); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Ingest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Ingest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Ingest.java index 17c9ee8..c0808fe 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Ingest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/Ingest.java @@ -132,7 +132,7 @@ public class Ingest { @Parameter(names = "--chunkSize", description = "the size of chunks when breaking down files") int chunkSize = 100000; @Parameter(description = " { ... }") - List directories = new ArrayList(); + List directories = new ArrayList<>(); } public static void main(String[] args) throws Exception { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/QueryUtil.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/QueryUtil.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/QueryUtil.java index a79b9d2..2c76264 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/QueryUtil.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/dirlist/QueryUtil.java @@ -143,7 +143,7 @@ public class QueryUtil { path = path.substring(0, path.length() - 1); Scanner scanner = conn.createScanner(tableName, auths); scanner.setRange(new Range(getRow(path))); - Map data = new TreeMap(); + Map data = new TreeMap<>(); for (Entry e : scanner) { String type = getType(e.getKey().getColumnFamily()); data.put("fullname", e.getKey().getRow().toString().substring(3)); @@ -161,7 +161,7 @@ public class QueryUtil { public Map> getDirList(String path) throws TableNotFoundException { if (!path.endsWith("/")) path = path + "/"; - Map> fim = new TreeMap>(); + Map> fim = new TreeMap<>(); Scanner scanner = conn.createScanner(tableName, auths); scanner.setRange(Range.prefix(getRow(path))); for (Entry e : scanner) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormat.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormat.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormat.java index f5da4e5..bb7715b 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormat.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormat.java @@ -45,8 +45,8 @@ public class ChunkInputFormat extends InputFormatBase>,Inp @Override public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException { super.initialize(inSplit, attempt); - peekingScannerIterator = new PeekingIterator>(scannerIterator); - currentK = new ArrayList>(); + peekingScannerIterator = new PeekingIterator<>(scannerIterator); + currentK = new ArrayList<>(); currentV = new ChunkInputStream(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStream.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStream.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStream.java index 0e6e319..1774227 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStream.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStream.java @@ -59,7 +59,7 @@ public class ChunkInputStream extends InputStream { if (source != null) throw new IOException("setting new source without closing old one"); this.source = in; - currentVis = new TreeSet(); + currentVis = new TreeSet<>(); count = pos = 0; if (!source.hasNext()) { log.debug("source has no next"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java index e899ff5..1a0ec5d 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java @@ -178,7 +178,7 @@ public class FileDataIngest { int chunkSize = 64 * 1024; @Parameter(description = " { ... }") - List files = new ArrayList(); + List files = new ArrayList<>(); } public static void main(String[] args) throws Exception { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java index 75e32ae..48746d0 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java @@ -49,7 +49,7 @@ public class FileDataQuery { throws AccumuloException, AccumuloSecurityException, TableNotFoundException { ZooKeeperInstance instance = new ZooKeeperInstance(ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zooKeepers)); conn = instance.getConnector(user, token); - lastRefs = new ArrayList>(); + lastRefs = new ArrayList<>(); cis = new ChunkInputStream(); scanner = conn.createScanner(tableName, auths); } @@ -62,7 +62,7 @@ public class FileDataQuery { scanner.setRange(new Range(hash)); scanner.setBatchSize(1); lastRefs.clear(); - PeekingIterator> pi = new PeekingIterator>(scanner.iterator()); + PeekingIterator> pi = new PeekingIterator<>(scanner.iterator()); if (pi.hasNext()) { while (!pi.peek().getKey().getColumnFamily().equals(FileDataIngest.CHUNK_CF)) { lastRefs.add(pi.peek()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/KeyUtil.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/KeyUtil.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/KeyUtil.java index 2f09785..f9c52ba 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/KeyUtil.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/KeyUtil.java @@ -50,7 +50,7 @@ public class KeyUtil { * @return an array of strings */ public static String[] splitNullSepText(Text t) { - ArrayList s = new ArrayList(); + ArrayList s = new ArrayList<>(); byte[] b = t.getBytes(); int lastindex = 0; for (int i = 0; i < t.getLength(); i++) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/VisibilityCombiner.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/VisibilityCombiner.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/VisibilityCombiner.java index ab2e7fc..b205ec1 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/VisibilityCombiner.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/VisibilityCombiner.java @@ -25,7 +25,7 @@ import org.apache.accumulo.core.data.ByteSequence; */ public class VisibilityCombiner { - private TreeSet visibilities = new TreeSet(); + private TreeSet visibilities = new TreeSet<>(); void add(ByteSequence cv) { if (cv.length() == 0) http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java index 9fe6857..a2afcdf 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/isolation/InterferenceTest.java @@ -108,7 +108,7 @@ public class InterferenceTest { // all columns in a row should have the same value, // use this hash set to track that - HashSet values = new HashSet(); + HashSet values = new HashSet<>(); for (Entry entry : scanner) { if (row == null) http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/NGramIngest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/NGramIngest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/NGramIngest.java index 441f6ad..3355454 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/NGramIngest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/NGramIngest.java @@ -87,7 +87,7 @@ public class NGramIngest extends Configured implements Tool { if (!opts.getConnector().tableOperations().exists(opts.getTableName())) { log.info("Creating table " + opts.getTableName()); opts.getConnector().tableOperations().create(opts.getTableName()); - SortedSet splits = new TreeSet(); + SortedSet splits = new TreeSet<>(); String numbers[] = "1 2 3 4 5 6 7 8 9".split("\\s"); String lower[] = "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("\\s"); String upper[] = "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("\\s"); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/RowHash.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/RowHash.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/RowHash.java index 9af2563..d27758e 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/RowHash.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/RowHash.java @@ -75,7 +75,7 @@ public class RowHash extends Configured implements Tool { Text cf = new Text(idx < 0 ? col : col.substring(0, idx)); Text cq = idx < 0 ? null : new Text(col.substring(idx + 1)); if (cf.getLength() > 0) - AccumuloInputFormat.fetchColumns(job, Collections.singleton(new Pair(cf, cq))); + AccumuloInputFormat.fetchColumns(job, Collections.singleton(new Pair<>(cf, cq))); job.setMapperClass(HashDataMapper.class); job.setMapOutputKeyClass(Text.class); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java index 7eb6b42..96603ad 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java @@ -60,7 +60,7 @@ public class TableToFile extends Configured implements Tool { public static class TTFMapper extends Mapper { @Override public void map(Key row, Value data, Context context) throws IOException, InterruptedException { - Map.Entry entry = new SimpleImmutableEntry(row, data); + Map.Entry entry = new SimpleImmutableEntry<>(row, data); context.write(NullWritable.get(), new Text(DefaultFormatter.formatEntry(entry, false))); context.setStatus("Outputed Value"); } @@ -77,13 +77,13 @@ public class TableToFile extends Configured implements Tool { job.setInputFormatClass(AccumuloInputFormat.class); opts.setAccumuloConfigs(job); - HashSet> columnsToFetch = new HashSet>(); + HashSet> columnsToFetch = new HashSet<>(); for (String col : opts.columns.split(",")) { int idx = col.indexOf(":"); Text cf = new Text(idx < 0 ? col : col.substring(0, idx)); Text cq = idx < 0 ? null : new Text(col.substring(idx + 1)); if (cf.getLength() > 0) - columnsToFetch.add(new Pair(cf, cq)); + columnsToFetch.add(new Pair<>(cf, cq)); } if (!columnsToFetch.isEmpty()) AccumuloInputFormat.fetchColumns(job, columnsToFetch); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java index b535513..0c1f3b4 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TeraSortIngest.java @@ -167,7 +167,7 @@ public class TeraSortIngest extends Configured implements Tool { int numSplits = job.getConfiguration().getInt(NUMSPLITS, 1); long rowsPerSplit = totalRows / numSplits; System.out.println("Generating " + totalRows + " using " + numSplits + " maps with step of " + rowsPerSplit); - ArrayList splits = new ArrayList(numSplits); + ArrayList splits = new ArrayList<>(numSplits); long currentRow = 0; for (int split = 0; split < numSplits - 1; ++split) { splits.add(new RangeInputSplit(currentRow, rowsPerSplit)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/SetupTable.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/SetupTable.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/SetupTable.java index 8651c39..0fc3110 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/SetupTable.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/bulk/SetupTable.java @@ -30,7 +30,7 @@ public class SetupTable { static class Opts extends ClientOnRequiredTable { @Parameter(description = " { ... } ") - List splits = new ArrayList(); + List splits = new ArrayList<>(); } public static void main(String[] args) throws Exception { @@ -40,7 +40,7 @@ public class SetupTable { conn.tableOperations().create(opts.getTableName()); if (!opts.splits.isEmpty()) { // create a table with initial partitions - TreeSet intialPartitions = new TreeSet(); + TreeSet intialPartitions = new TreeSet<>(); for (String split : opts.splits) { intialPartitions.add(new Text(split)); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java index b9e1a83..978dbdc 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/reservations/ARS.java @@ -230,7 +230,7 @@ public class ARS { scanner.setRange(new Range(row)); scanner.fetchColumnFamily(new Text("res")); - List reservations = new ArrayList(); + List reservations = new ArrayList<>(); for (Entry entry : scanner) { String val = entry.getValue().toString(); @@ -255,7 +255,7 @@ public class ARS { // start up multiple threads all trying to reserve the same resource, no more than one should succeed final ARS fars = ars; - ArrayList threads = new ArrayList(); + ArrayList threads = new ArrayList<>(); for (int i = 3; i < tokens.length; i++) { final int whoIndex = i; Runnable reservationTask = new Runnable() { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/ContinuousQuery.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/ContinuousQuery.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/ContinuousQuery.java index 00ec5a3..95179c0 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/ContinuousQuery.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/ContinuousQuery.java @@ -98,8 +98,8 @@ public class ContinuousQuery { Text currentRow = null; - ArrayList words = new ArrayList(); - ArrayList ret = new ArrayList(); + ArrayList words = new ArrayList<>(); + ArrayList ret = new ArrayList<>(); Random rand = new Random(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Index.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Index.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Index.java index bc76c03..ba1e32e 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Index.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Index.java @@ -53,7 +53,7 @@ public class Index { Mutation m = new Mutation(partition); - HashSet tokensSeen = new HashSet(); + HashSet tokensSeen = new HashSet<>(); for (String token : tokens) { token = token.toLowerCase(); @@ -98,7 +98,7 @@ public class Index { @Parameter(names = "--partitions", required = true, description = "the number of shards to create") int partitions; @Parameter(required = true, description = " { ... }") - List files = new ArrayList(); + List files = new ArrayList<>(); } public static void main(String[] args) throws Exception { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java index 41d5dc7..194d553 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shard/Query.java @@ -45,7 +45,7 @@ public class Query { static class Opts extends ClientOnRequiredTable { @Parameter(description = " term { ... }") - List terms = new ArrayList(); + List terms = new ArrayList<>(); } public static List query(BatchScanner bs, List terms) { @@ -59,7 +59,7 @@ public class Query { IntersectingIterator.setColumnFamilies(ii, columns); bs.addScanIterator(ii); bs.setRanges(Collections.singleton(new Range())); - List result = new ArrayList(); + List result = new ArrayList<>(); for (Entry entry : bs) { result.add(entry.getKey().getColumnQualifier().toString()); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shell/DebugCommand.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shell/DebugCommand.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shell/DebugCommand.java index e429f62..4395fe7 100644 --- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shell/DebugCommand.java +++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/shell/DebugCommand.java @@ -27,7 +27,7 @@ public class DebugCommand extends Command { @Override public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { - Set lines = new TreeSet(); + Set lines = new TreeSet<>(); lines.add("This is a test"); shellState.printLines(lines.iterator(), true); return 0; http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java index f089d42..e569dff 100644 --- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java +++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java @@ -82,11 +82,11 @@ public class CountTest extends TestCase { 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/95f42858/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkCombinerTest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkCombinerTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkCombinerTest.java index 9efd68b..40f4bb9 100644 --- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkCombinerTest.java +++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkCombinerTest.java @@ -135,22 +135,22 @@ public class ChunkCombinerTest extends TestCase { @Override protected void setUp() { - row1 = new TreeMap(); - row2 = new TreeMap(); - row3 = new TreeMap(); - allRows = new TreeMap(); + row1 = new TreeMap<>(); + row2 = new TreeMap<>(); + row3 = new TreeMap<>(); + allRows = new TreeMap<>(); - cRow1 = new TreeMap(); - cRow2 = new TreeMap(); - cRow3 = new TreeMap(); - allCRows = new TreeMap(); + cRow1 = new TreeMap<>(); + cRow2 = new TreeMap<>(); + cRow3 = new TreeMap<>(); + allCRows = new TreeMap<>(); - cOnlyRow1 = new TreeMap(); - cOnlyRow2 = new TreeMap(); - cOnlyRow3 = new TreeMap(); - allCOnlyRows = new TreeMap(); + cOnlyRow1 = new TreeMap<>(); + cOnlyRow2 = new TreeMap<>(); + cOnlyRow3 = new TreeMap<>(); + allCOnlyRows = new TreeMap<>(); - badrow = new TreeMap(); + badrow = new TreeMap<>(); String refs = FileDataIngest.REFS_CF.toString(); String fileext = FileDataIngest.REFS_FILE_EXT; @@ -218,7 +218,7 @@ public class ChunkCombinerTest extends TestCase { allCOnlyRows.putAll(cOnlyRow3); } - private static final Collection emptyColfs = new HashSet(); + private static final Collection emptyColfs = new HashSet<>(); public void test1() throws IOException { runTest(false, allRows, allCRows, emptyColfs); @@ -241,7 +241,7 @@ public class ChunkCombinerTest extends TestCase { iter = iter.deepCopy(null); iter.seek(new Range(), cols, true); - TreeMap seen = new TreeMap(); + TreeMap seen = new TreeMap<>(); while (iter.hasTop()) { assertFalse("already contains " + iter.getTopKey(), seen.containsKey(iter.getTopKey())); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java index b95c00c..0fb06ef 100644 --- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java +++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java @@ -66,7 +66,7 @@ public class ChunkInputFormatTest { public static void setupClass() { System.setProperty("hadoop.tmp.dir", System.getProperty("user.dir") + "/target/hadoop-tmp"); - data = new ArrayList>(); + data = new ArrayList<>(); ChunkInputStreamTest.addData(data, "a", "refs", "ida\0ext", "A&B", "ext"); ChunkInputStreamTest.addData(data, "a", "refs", "ida\0name", "A&B", "name"); ChunkInputStreamTest.addData(data, "a", "~chunk", 100, 0, "A&B", "asdfjkl;"); @@ -78,7 +78,7 @@ public class ChunkInputFormatTest { ChunkInputStreamTest.addData(data, "b", "~chunk", 100, 1, "A&B", ""); ChunkInputStreamTest.addData(data, "b", "~chunk", 100, 1, "B&C", ""); ChunkInputStreamTest.addData(data, "b", "~chunk", 100, 1, "D", ""); - baddata = new ArrayList>(); + baddata = new ArrayList<>(); ChunkInputStreamTest.addData(baddata, "c", "refs", "ida\0ext", "A&B", "ext"); ChunkInputStreamTest.addData(baddata, "c", "refs", "ida\0name", "A&B", "name"); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java ---------------------------------------------------------------------- diff --git a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java index 3d860ce..f4b765f 100644 --- a/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java +++ b/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java @@ -54,7 +54,7 @@ public class ChunkInputStreamTest { List> multidata; { - 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;"); @@ -72,7 +72,7 @@ public class ChunkInputStreamTest { 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", ""); @@ -86,7 +86,7 @@ public class ChunkInputStreamTest { 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;"); @@ -110,8 +110,8 @@ public class ChunkInputStreamTest { @Test public void testExceptionOnMultipleSetSourceWithoutClose() throws IOException { ChunkInputStream cis = new ChunkInputStream(); - PeekingIterator> pi = new PeekingIterator>(data.iterator()); - pi = new PeekingIterator>(data.iterator()); + PeekingIterator> pi = new PeekingIterator<>(data.iterator()); + pi = new PeekingIterator<>(data.iterator()); cis.setSource(pi); try { cis.setSource(pi); @@ -125,7 +125,7 @@ public class ChunkInputStreamTest { @Test public void testExceptionOnGetVisBeforeClose() throws IOException { ChunkInputStream cis = new ChunkInputStream(); - PeekingIterator> pi = new PeekingIterator>(data.iterator()); + PeekingIterator> pi = new PeekingIterator<>(data.iterator()); cis.setSource(pi); try { @@ -143,7 +143,7 @@ public class ChunkInputStreamTest { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[5]; - PeekingIterator> pi = new PeekingIterator>(data.iterator()); + PeekingIterator> pi = new PeekingIterator<>(data.iterator()); cis.setSource(pi); int read; @@ -195,7 +195,7 @@ public class ChunkInputStreamTest { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[20]; int read; - PeekingIterator> pi = new PeekingIterator>(data.iterator()); + PeekingIterator> pi = new PeekingIterator<>(data.iterator()); cis.setSource(pi); assertEquals(read = cis.read(b), 8); @@ -248,7 +248,7 @@ public class ChunkInputStreamTest { 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); @@ -307,7 +307,7 @@ public class ChunkInputStreamTest { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[20]; int read; - PeekingIterator> pi = new PeekingIterator>(baddata.iterator()); + PeekingIterator> pi = new PeekingIterator<>(baddata.iterator()); cis.setSource(pi); assumeExceptionOnRead(cis, b); @@ -353,7 +353,7 @@ public class ChunkInputStreamTest { assertFalse(pi.hasNext()); - pi = new PeekingIterator>(baddata.iterator()); + pi = new PeekingIterator<>(baddata.iterator()); cis.setSource(pi); assumeExceptionOnClose(cis); } @@ -363,7 +363,7 @@ public class ChunkInputStreamTest { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[20]; int read; - PeekingIterator> pi = new PeekingIterator>(baddata.iterator()); + PeekingIterator> pi = new PeekingIterator<>(baddata.iterator()); cis.setSource(pi); assumeExceptionOnRead(cis, b); @@ -404,7 +404,7 @@ public class ChunkInputStreamTest { assertFalse(pi.hasNext()); - pi = new PeekingIterator>(baddata.iterator()); + pi = new PeekingIterator<>(baddata.iterator()); cis.setSource(pi); assumeExceptionOnClose(cis); } @@ -414,7 +414,7 @@ public class ChunkInputStreamTest { ChunkInputStream cis = new ChunkInputStream(); byte[] b = new byte[20]; int read; - PeekingIterator> pi = new PeekingIterator>(multidata.iterator()); + PeekingIterator> pi = new PeekingIterator<>(multidata.iterator()); b = new byte[20]; @@ -441,7 +441,7 @@ public class ChunkInputStreamTest { @Test public void testSingleByteRead() throws IOException { ChunkInputStream cis = new ChunkInputStream(); - PeekingIterator> pi = new PeekingIterator>(data.iterator()); + PeekingIterator> pi = new PeekingIterator<>(data.iterator()); cis.setSource(pi); assertEquals((byte) 'a', (byte) cis.read()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java index 8532e92..f6aa811 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java +++ b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java @@ -68,15 +68,15 @@ public class AdminUtil { public void print(ReadOnlyTStore zs, IZooReaderWriter zk, String lockPath, Formatter fmt, Set filterTxid, EnumSet filterStatus) throws KeeperException, InterruptedException { - Map> heldLocks = new HashMap>(); - Map> waitingLocks = new HashMap>(); + Map> heldLocks = new HashMap<>(); + Map> waitingLocks = new HashMap<>(); List lockedIds = zk.getChildren(lockPath); for (String id : lockedIds) { try { List lockNodes = zk.getChildren(lockPath + "/" + id); - lockNodes = new ArrayList(lockNodes); + lockNodes = new ArrayList<>(lockNodes); Collections.sort(lockNodes); int pos = 0; @@ -104,7 +104,7 @@ public class AdminUtil { List tables = locks.get(Long.parseLong(lda[1], 16)); if (tables == null) { - tables = new ArrayList(); + tables = new ArrayList<>(); locks.put(Long.parseLong(lda[1], 16), tables); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java b/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java index d023c27..75da2f2 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java +++ b/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java @@ -70,7 +70,7 @@ public class AgeOffStore implements TStore { } public void ageOff() { - HashSet oldTxs = new HashSet(); + HashSet oldTxs = new HashSet<>(); synchronized (this) { long time = timeSource.currentTimeMillis(); @@ -114,7 +114,7 @@ public class AgeOffStore implements TStore { this.store = store; this.ageOffTime = ageOffTime; this.timeSource = timeSource; - candidates = new HashMap(); + candidates = new HashMap<>(); minTime = Long.MAX_VALUE; http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java index 0ca59dd..7c63526 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java +++ b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java @@ -86,7 +86,7 @@ public class ReadOnlyStore implements ReadOnlyTStore { @Override public ReadOnlyRepo top(long tid) { - return new ReadOnlyRepoWrapper(store.top(tid)); + return new ReadOnlyRepoWrapper<>(store.top(tid)); } @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java b/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java index 4b4a83f..862588c 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java +++ b/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java @@ -97,8 +97,8 @@ public class ZooStore implements TStore { this.path = path; this.zk = zk; - this.reserved = new HashSet(); - this.defered = new HashMap(); + this.reserved = new HashSet<>(); + this.defered = new HashMap<>(); this.idgenerator = new SecureRandom(); zk.putPersistentData(path, new byte[0], NodeExistsPolicy.SKIP); @@ -130,7 +130,7 @@ public class ZooStore implements TStore { events = statusChangeEvents; } - List txdirs = new ArrayList(zk.getChildren(path)); + List txdirs = new ArrayList<>(zk.getChildren(path)); Collections.sort(txdirs); synchronized (this) { @@ -287,7 +287,7 @@ public class ZooStore implements TStore { private String findTop(String txpath) throws KeeperException, InterruptedException { List ops = zk.getChildren(txpath); - ops = new ArrayList(ops); + ops = new ArrayList<>(ops); String max = ""; @@ -448,7 +448,7 @@ public class ZooStore implements TStore { @Override public List list() { try { - ArrayList l = new ArrayList(); + ArrayList l = new ArrayList<>(); List transactions = zk.getChildren(path); for (String txid : transactions) { l.add(parseTid(txid)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java index dda7db9..b10ddea 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java @@ -33,7 +33,7 @@ public class TransactionWatcher { } private static final Logger log = LoggerFactory.getLogger(TransactionWatcher.class); - final private Map counts = new HashMap(); + final private Map counts = new HashMap<>(); final private Arbitrator arbitrator; public TransactionWatcher(Arbitrator arbitrator) { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java index 503e56c..ba837f8 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java @@ -155,9 +155,9 @@ public class ZooCache { */ public ZooCache(ZooReader reader, Watcher watcher) { this.zReader = reader; - this.cache = new HashMap(); - this.statCache = new HashMap(); - this.childrenCache = new HashMap>(); + this.cache = new HashMap<>(); + this.statCache = new HashMap<>(); + this.childrenCache = new HashMap<>(); this.externalWatcher = watcher; } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java index 1475928..9fecf2e 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCacheFactory.java @@ -26,7 +26,7 @@ import org.apache.zookeeper.Watcher; */ public class ZooCacheFactory { // TODO: make this better - LRU, soft references, ... - private static Map instances = new HashMap(); + private static Map instances = new HashMap<>(); /** * Gets a {@link ZooCache}. The same object may be returned for multiple calls with the same arguments. http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java index 992a444..90fb4aa 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java @@ -404,7 +404,7 @@ public class ZooLock implements Watcher { return false; } - children = new ArrayList(children); + children = new ArrayList<>(children); Collections.sort(children); String lockNode = children.get(0); @@ -437,7 +437,7 @@ public class ZooLock implements Watcher { return null; } - children = new ArrayList(children); + children = new ArrayList<>(children); Collections.sort(children); String lockNode = children.get(0); @@ -456,7 +456,7 @@ public class ZooLock implements Watcher { return 0; } - children = new ArrayList(children); + children = new ArrayList<>(children); Collections.sort(children); String lockNode = children.get(0); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java index 1b22dc9..25c735b 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java @@ -68,7 +68,7 @@ public class ZooQueueLock implements QueueLock { @Override public SortedMap getEarlierEntries(long entry) { - SortedMap result = new TreeMap(); + SortedMap result = new TreeMap<>(); try { List children = Collections.emptyList(); try { http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java index 837785f..b9fedac 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java @@ -51,7 +51,7 @@ public class ZooSession { ZooKeeper zooKeeper; } - private static Map sessions = new HashMap(); + private static Map sessions = new HashMap<>(); private static String sessionKey(String keepers, int timeout, String scheme, byte[] auth) { return keepers + ":" + timeout + ":" + (scheme == null ? "" : scheme) + ":" + (auth == null ? "" : new String(auth, UTF_8)); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java index 4c4aa13..6ea10d0 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java @@ -161,9 +161,9 @@ public class ZooUtil { private static final RetryFactory RETRY_FACTORY; static { - PRIVATE = new ArrayList(); + PRIVATE = new ArrayList<>(); PRIVATE.addAll(Ids.CREATOR_ALL_ACL); - PUBLIC = new ArrayList(); + PUBLIC = new ArrayList<>(); PUBLIC.addAll(PRIVATE); PUBLIC.add(new ACL(Perms.READ, Ids.ANYONE_ID_UNSAFE)); RETRY_FACTORY = RetryFactory.DEFAULT_INSTANCE; @@ -483,7 +483,7 @@ public class ZooUtil { return null; } - children = new ArrayList(children); + children = new ArrayList<>(children); Collections.sort(children); String lockNode = children.get(0); http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/test/java/org/apache/accumulo/fate/AgeOffStoreTest.java ---------------------------------------------------------------------- diff --git a/fate/src/test/java/org/apache/accumulo/fate/AgeOffStoreTest.java b/fate/src/test/java/org/apache/accumulo/fate/AgeOffStoreTest.java index 2c3b813..9549bd8 100644 --- a/fate/src/test/java/org/apache/accumulo/fate/AgeOffStoreTest.java +++ b/fate/src/test/java/org/apache/accumulo/fate/AgeOffStoreTest.java @@ -43,8 +43,8 @@ public class AgeOffStoreTest { public void testBasic() { TestTimeSource tts = new TestTimeSource(); - SimpleStore sstore = new SimpleStore(); - AgeOffStore aoStore = new AgeOffStore(sstore, 10, tts); + SimpleStore sstore = new SimpleStore<>(); + AgeOffStore aoStore = new AgeOffStore<>(sstore, 10, tts); aoStore.ageOff(); @@ -73,22 +73,22 @@ public class AgeOffStoreTest { aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet(aoStore.list())); - Assert.assertEquals(4, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); + Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); tts.time = 15; aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1, txid3, txid4)), new HashSet(aoStore.list())); - Assert.assertEquals(3, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid3, txid4)), new HashSet<>(aoStore.list())); + Assert.assertEquals(3, new HashSet<>(aoStore.list()).size()); tts.time = 30; aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1)), new HashSet(aoStore.list())); - Assert.assertEquals(1, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); + Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); } @Test @@ -96,7 +96,7 @@ public class AgeOffStoreTest { // test age off when source store starts off non empty TestTimeSource tts = new TestTimeSource(); - SimpleStore sstore = new SimpleStore(); + SimpleStore sstore = new SimpleStore<>(); Long txid1 = sstore.create(); sstore.reserve(txid1); sstore.setStatus(txid1, TStatus.IN_PROGRESS); @@ -116,22 +116,22 @@ public class AgeOffStoreTest { Long txid4 = sstore.create(); - AgeOffStore aoStore = new AgeOffStore(sstore, 10, tts); + AgeOffStore aoStore = new AgeOffStore<>(sstore, 10, tts); - Assert.assertEquals(new HashSet(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet(aoStore.list())); - Assert.assertEquals(4, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); + Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet(aoStore.list())); - Assert.assertEquals(4, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); + Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); tts.time = 15; aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1)), new HashSet(aoStore.list())); - Assert.assertEquals(1, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); + Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); aoStore.reserve(txid1); aoStore.setStatus(txid1, TStatus.FAILED_IN_PROGRESS); @@ -141,8 +141,8 @@ public class AgeOffStoreTest { aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1)), new HashSet(aoStore.list())); - Assert.assertEquals(1, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); + Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); aoStore.reserve(txid1); aoStore.setStatus(txid1, TStatus.FAILED); @@ -150,13 +150,13 @@ public class AgeOffStoreTest { aoStore.ageOff(); - Assert.assertEquals(new HashSet(Arrays.asList(txid1)), new HashSet(aoStore.list())); - Assert.assertEquals(1, new HashSet(aoStore.list()).size()); + Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); + Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); tts.time = 42; aoStore.ageOff(); - Assert.assertEquals(0, new HashSet(aoStore.list()).size()); + Assert.assertEquals(0, new HashSet<>(aoStore.list()).size()); } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/95f42858/fate/src/test/java/org/apache/accumulo/fate/ReadOnlyStoreTest.java ---------------------------------------------------------------------- diff --git a/fate/src/test/java/org/apache/accumulo/fate/ReadOnlyStoreTest.java b/fate/src/test/java/org/apache/accumulo/fate/ReadOnlyStoreTest.java index eea5f1b..e8f0cee 100644 --- a/fate/src/test/java/org/apache/accumulo/fate/ReadOnlyStoreTest.java +++ b/fate/src/test/java/org/apache/accumulo/fate/ReadOnlyStoreTest.java @@ -51,7 +51,7 @@ public class ReadOnlyStoreTest { EasyMock.replay(repo); EasyMock.replay(mock); - ReadOnlyTStore store = new ReadOnlyStore(mock); + ReadOnlyTStore store = new ReadOnlyStore<>(mock); Assert.assertEquals(0xdeadbeefl, store.reserve()); store.reserve(0xdeadbeefl); ReadOnlyRepo top = store.top(0xdeadbeefl);