You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2016/11/04 22:17:02 UTC
[25/48] accumulo git commit: ACCUMULO-4514 Remove unnecessary code
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Class<? extends ReversingKeyTransformingIterator>> classes = new ArrayList<Class<? extends ReversingKeyTransformingIterator>>();
+ List<Class<? extends ReversingKeyTransformingIterator>> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> expected = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<String,String> opts = new HashMap<String,String>();
+ Map<String,String> 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<ByteSequence> untransformColumnFamilies(Collection<ByteSequence> columnFamilies) {
- HashSet<ByteSequence> untransformed = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> untransformed = new HashSet<>();
for (ByteSequence cf : columnFamilies)
untransformed.add(untransformColumnFamily(cf));
return untransformed;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
private static final Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
private static final Logger log = LoggerFactory.getLogger(VersioningIteratorTest.class);
@@ -56,7 +56,7 @@ public class VersioningIteratorTest {
}
TreeMap<Key,Value> iteratorOverTestData(VersioningIterator it) throws IOException {
- TreeMap<Key,Value> tmOut = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
createTestData(tm, colf, colq);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> 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<Key,Value> createUnprotectedSource(int numPublic, int numHidden) {
- TreeMap<Key,Value> source = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> createPollutedSource(int numGood, int numBad) {
- TreeMap<Key,Value> source = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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<Key,Value> createSourceWithHiddenData(int numViewable, int numHidden) {
- TreeMap<Key,Value> source = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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/717febbf/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<Key,Value> map = new TreeMap<Key,Value>();
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
- final Map<Text,Boolean> toInclude = new HashMap<Text,Boolean>();
+ SortedMap<Key,Value> map = new TreeMap<>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
+ final Map<Text,Boolean> 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<Key,Value> resultMap = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> resultMap = new TreeMap<>();
iter.seek(new Range(), new ArrayList<ByteSequence>(), false);
int numRows = 0;
while (iter.hasTop()) {
@@ -129,19 +129,19 @@ public class WholeColumnFamilyIteratorTest extends TestCase {
}
public void testContinue() throws Exception {
- SortedMap<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo");
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo");
pkv(map2, "row2", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map3 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map3 = new TreeMap<>();
pkv(map3, "row3", "cf1", "cq1", "cv1", 5, "foo");
pkv(map3, "row3", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> 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<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo");
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo");
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map = new TreeMap<>();
map.putAll(map1);
map.putAll(map2);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value> map = new TreeMap<Key,Value>();
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
- final Map<Text,Boolean> toInclude = new HashMap<Text,Boolean>();
+ SortedMap<Key,Value> map = new TreeMap<>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
+ final Map<Text,Boolean> 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<Key,Value> resultMap = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> resultMap = new TreeMap<>();
iter.seek(new Range(), new ArrayList<ByteSequence>(), false);
int numRows = 0;
while (iter.hasTop()) {
@@ -126,19 +126,19 @@ public class WholeRowIteratorTest {
@Test
public void testContinue() throws Exception {
- SortedMap<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo");
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo");
pkv(map2, "row2", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map3 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map3 = new TreeMap<>();
pkv(map3, "row3", "cf1", "cq1", "cv1", 5, "foo");
pkv(map3, "row3", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> 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<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, "foo");
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, "bar");
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
pkv(map2, "row2", "cf1", "cq1", "cv1", 5, "foo");
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map = new TreeMap<>();
map.putAll(map1);
map.putAll(map2);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Text> in = new HashSet<Text>();
- HashSet<ByteSequence> in2 = new HashSet<ByteSequence>();
+ HashSet<Text> in = new HashSet<>();
+ HashSet<ByteSequence> 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/717febbf/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<List<Size>> merges = new ArrayList<List<Size>>();
- public List<Size> tablets = new ArrayList<Size>();
+ public List<List<Size>> merges = new ArrayList<>();
+ public List<Size> 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<Size> sizes, int numToMerge) throws MergeException {
- List<Size> merge = new ArrayList<Size>();
+ List<Size> 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/717febbf/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<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
- Pair<Integer,String> pair2 = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
+ Pair<Integer,String> pair2 = new Pair<>(25, "twenty-five");
assertEquals(pair, pair2);
}
@@ -40,7 +40,7 @@ public class PairTest {
*/
@Test
public void testGetFirst() {
- Pair<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
assertEquals((Integer) 25, pair.getFirst());
}
@@ -49,7 +49,7 @@ public class PairTest {
*/
@Test
public void testGetSecond() {
- Pair<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
assertEquals("twenty-five", pair.getSecond());
}
@@ -58,7 +58,7 @@ public class PairTest {
*/
@Test
public void testToString() {
- Pair<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
assertEquals("(25,twenty-five)", pair.toString());
}
@@ -67,7 +67,7 @@ public class PairTest {
*/
@Test
public void testToStringStringStringString() {
- Pair<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
assertEquals("---25~~~twenty-five+++", pair.toString("---", "~~~", "+++"));
}
@@ -76,7 +76,7 @@ public class PairTest {
*/
@Test
public void testToMapEntry() {
- Pair<Integer,String> pair = new Pair<Integer,String>(10, "IO");
+ Pair<Integer,String> pair = new Pair<>(10, "IO");
Entry<Integer,String> entry = pair.toMapEntry();
assertEquals(pair.getFirst(), entry.getKey());
@@ -88,9 +88,9 @@ public class PairTest {
*/
@Test
public void testSwap() {
- Pair<Integer,String> pair = new Pair<Integer,String>(25, "twenty-five");
+ Pair<Integer,String> pair = new Pair<>(25, "twenty-five");
assertEquals(pair, pair.swap().swap());
- Pair<String,Integer> pair2 = new Pair<String,Integer>("twenty-five", 25);
+ Pair<String,Integer> 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<Integer,String> entry = new SimpleImmutableEntry<Integer,String>(10, "IO");
+ Entry<Integer,String> entry = new SimpleImmutableEntry<>(10, "IO");
Pair<Integer,String> pair0 = Pair.fromEntry(entry);
assertEquals(entry.getKey(), pair0.getFirst());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key> toKeySet(Mutation... expected) {
- HashSet<Key> ret = new HashSet<Key>();
+ HashSet<Key> 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/717febbf/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<Key,Value>();
+ data = new TreeMap<>();
data.put(new Key("", "", "", 0), new Value());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value>();
+ data = new TreeMap<>();
formatter = new HexFormatter();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value>();
+ data = new TreeMap<>();
formatter = new ShardedTableDistributionFormatter();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value>();
+ data = new TreeMap<>();
formatter = new StatisticsDisplayFormatter();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Range> ranges = new HashSet<Range>(num);
- HashMap<Text,Boolean> expectedRows = new java.util.HashMap<Text,Boolean>();
+ HashSet<Range> ranges = new HashSet<>(num);
+ HashMap<Text,Boolean> expectedRows = new java.util.HashMap<>();
generateRandomQueries(num, min, max, r, ranges, expectedRows);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Long> rowids = new HashSet<Long>(opts.num);
+ HashSet<Long> 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<String,Set<SecurityErrorCode>> tables = new HashMap<String,Set<SecurityErrorCode>>();
+ HashMap<String,Set<SecurityErrorCode>> tables = new HashMap<>();
for (Entry<TabletId,Set<SecurityErrorCode>> ke : e.getSecurityErrorCodes().entrySet()) {
Set<SecurityErrorCode> secCodes = tables.get(ke.getKey().getTableId().toString());
if (secCodes == null) {
- secCodes = new HashSet<SecurityErrorCode>();
+ secCodes = new HashSet<>();
tables.put(ke.getKey().getTableId().toString(), secCodes);
}
secCodes.addAll(ke.getValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Text> partitionKeys = new TreeSet<Text>();
+ SortedSet<Text> 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/717febbf/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<Short> addViolation(Set<Short> violations, short violation) {
if (violations == null) {
- violations = new LinkedHashSet<Short>();
+ violations = new LinkedHashSet<>();
violations.add(violation);
} else if (!violations.contains(violation)) {
violations.add(violation);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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 = "<dir> { <dir> ... }")
- List<String> directories = new ArrayList<String>();
+ List<String> directories = new ArrayList<>();
}
public static void main(String[] args) throws Exception {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String,String> data = new TreeMap<String,String>();
+ Map<String,String> data = new TreeMap<>();
for (Entry<Key,Value> 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<String,Map<String,String>> getDirList(String path) throws TableNotFoundException {
if (!path.endsWith("/"))
path = path + "/";
- Map<String,Map<String,String>> fim = new TreeMap<String,Map<String,String>>();
+ Map<String,Map<String,String>> fim = new TreeMap<>();
Scanner scanner = conn.createScanner(tableName, auths);
scanner.setRange(Range.prefix(getRow(path)));
for (Entry<Key,Value> e : scanner) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<List<Entry<Key,Value>>,Inp
@Override
public void initialize(InputSplit inSplit, TaskAttemptContext attempt) throws IOException {
super.initialize(inSplit, attempt);
- peekingScannerIterator = new PeekingIterator<Entry<Key,Value>>(scannerIterator);
- currentK = new ArrayList<Entry<Key,Value>>();
+ peekingScannerIterator = new PeekingIterator<>(scannerIterator);
+ currentK = new ArrayList<>();
currentV = new ChunkInputStream();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Text>();
+ 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/717febbf/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 = "<file> { <file> ... }")
- List<String> files = new ArrayList<String>();
+ List<String> files = new ArrayList<>();
}
public static void main(String[] args) throws Exception {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Entry<Key,Value>>();
+ 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(scanner.iterator());
+ PeekingIterator<Entry<Key,Value>> 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/717febbf/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<String> s = new ArrayList<String>();
+ ArrayList<String> 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/717febbf/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<String> visibilities = new TreeSet<String>();
+ private TreeSet<String> visibilities = new TreeSet<>();
void add(ByteSequence cv) {
if (cv.length() == 0)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> values = new HashSet<String>();
+ HashSet<String> values = new HashSet<>();
for (Entry<Key,Value> entry : scanner) {
if (row == null)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Text> splits = new TreeSet<Text>();
+ SortedSet<Text> 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/717febbf/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<Text,Text>(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/717febbf/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<Key,Value,NullWritable,Text> {
@Override
public void map(Key row, Value data, Context context) throws IOException, InterruptedException {
- Map.Entry<Key,Value> entry = new SimpleImmutableEntry<Key,Value>(row, data);
+ Map.Entry<Key,Value> 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<Pair<Text,Text>> columnsToFetch = new HashSet<Pair<Text,Text>>();
+ HashSet<Pair<Text,Text>> 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<Text,Text>(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/717febbf/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<InputSplit> splits = new ArrayList<InputSplit>(numSplits);
+ ArrayList<InputSplit> 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/717febbf/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 = "<split> { <split> ... } ")
- List<String> splits = new ArrayList<String>();
+ List<String> 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<Text> intialPartitions = new TreeSet<Text>();
+ TreeSet<Text> intialPartitions = new TreeSet<>();
for (String split : opts.splits) {
intialPartitions.add(new Text(split));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> reservations = new ArrayList<String>();
+ List<String> reservations = new ArrayList<>();
for (Entry<Key,Value> 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<Thread> threads = new ArrayList<Thread>();
+ ArrayList<Thread> 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/717febbf/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<Text> words = new ArrayList<Text>();
- ArrayList<Text[]> ret = new ArrayList<Text[]>();
+ ArrayList<Text> words = new ArrayList<>();
+ ArrayList<Text[]> ret = new ArrayList<>();
Random rand = new Random();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> tokensSeen = new HashSet<String>();
+ HashSet<String> 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 = "<file> { <file> ... }")
- List<String> files = new ArrayList<String>();
+ List<String> files = new ArrayList<>();
}
public static void main(String[] args) throws Exception {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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 { <term> ... }")
- List<String> terms = new ArrayList<String>();
+ List<String> terms = new ArrayList<>();
}
public static List<String> query(BatchScanner bs, List<String> terms) {
@@ -59,7 +59,7 @@ public class Query {
IntersectingIterator.setColumnFamilies(ii, columns);
bs.addScanIterator(ii);
bs.setRanges(Collections.singleton(new Range()));
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
for (Entry<Key,Value> entry : bs) {
result.add(entry.getKey().getColumnQualifier().toString());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> lines = new TreeSet<String>();
+ Set<String> 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/717febbf/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<Pair<String,String>> expected = new ArrayList<Pair<String,String>>();
- expected.add(new Pair<String,String>(QueryUtil.getRow("").toString(), "1,0,3,3"));
- expected.add(new Pair<String,String>(QueryUtil.getRow("/local").toString(), "2,1,2,3"));
- expected.add(new Pair<String,String>(QueryUtil.getRow("/local/user1").toString(), "0,2,0,2"));
- expected.add(new Pair<String,String>(QueryUtil.getRow("/local/user2").toString(), "0,0,0,0"));
+ ArrayList<Pair<String,String>> 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<Key,Value> e : scanner) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Key,Value>();
- row2 = new TreeMap<Key,Value>();
- row3 = new TreeMap<Key,Value>();
- allRows = new TreeMap<Key,Value>();
+ row1 = new TreeMap<>();
+ row2 = new TreeMap<>();
+ row3 = new TreeMap<>();
+ allRows = new TreeMap<>();
- cRow1 = new TreeMap<Key,Value>();
- cRow2 = new TreeMap<Key,Value>();
- cRow3 = new TreeMap<Key,Value>();
- allCRows = new TreeMap<Key,Value>();
+ cRow1 = new TreeMap<>();
+ cRow2 = new TreeMap<>();
+ cRow3 = new TreeMap<>();
+ allCRows = new TreeMap<>();
- cOnlyRow1 = new TreeMap<Key,Value>();
- cOnlyRow2 = new TreeMap<Key,Value>();
- cOnlyRow3 = new TreeMap<Key,Value>();
- allCOnlyRows = new TreeMap<Key,Value>();
+ cOnlyRow1 = new TreeMap<>();
+ cOnlyRow2 = new TreeMap<>();
+ cOnlyRow3 = new TreeMap<>();
+ allCOnlyRows = new TreeMap<>();
- badrow = new TreeMap<Key,Value>();
+ 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<ByteSequence> emptyColfs = new HashSet<ByteSequence>();
+ private static final Collection<ByteSequence> 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<Key,Value> seen = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> 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/717febbf/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<Entry<Key,Value>>();
+ 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<Entry<Key,Value>>();
+ 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/717febbf/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<Entry<Key,Value>> multidata;
{
- data = new ArrayList<Entry<Key,Value>>();
+ 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<Entry<Key,Value>>();
+ 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<Entry<Key,Value>>();
+ 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
- pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(scan.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(baddata.iterator());
+ PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<>(baddata.iterator());
cis.setSource(pi);
assumeExceptionOnRead(cis, b);
@@ -353,7 +353,7 @@ public class ChunkInputStreamTest {
assertFalse(pi.hasNext());
- pi = new PeekingIterator<Entry<Key,Value>>(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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(baddata.iterator());
+ PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<>(baddata.iterator());
cis.setSource(pi);
assumeExceptionOnRead(cis, b);
@@ -404,7 +404,7 @@ public class ChunkInputStreamTest {
assertFalse(pi.hasNext());
- pi = new PeekingIterator<Entry<Key,Value>>(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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(multidata.iterator());
+ PeekingIterator<Entry<Key,Value>> 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<Entry<Key,Value>> pi = new PeekingIterator<Entry<Key,Value>>(data.iterator());
+ PeekingIterator<Entry<Key,Value>> pi = new PeekingIterator<>(data.iterator());
cis.setSource(pi);
assertEquals((byte) 'a', (byte) cis.read());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<T> {
public void print(ReadOnlyTStore<T> zs, IZooReaderWriter zk, String lockPath, Formatter fmt, Set<Long> filterTxid, EnumSet<TStatus> filterStatus)
throws KeeperException, InterruptedException {
- Map<Long,List<String>> heldLocks = new HashMap<Long,List<String>>();
- Map<Long,List<String>> waitingLocks = new HashMap<Long,List<String>>();
+ Map<Long,List<String>> heldLocks = new HashMap<>();
+ Map<Long,List<String>> waitingLocks = new HashMap<>();
List<String> lockedIds = zk.getChildren(lockPath);
for (String id : lockedIds) {
try {
List<String> lockNodes = zk.getChildren(lockPath + "/" + id);
- lockNodes = new ArrayList<String>(lockNodes);
+ lockNodes = new ArrayList<>(lockNodes);
Collections.sort(lockNodes);
int pos = 0;
@@ -104,7 +104,7 @@ public class AdminUtil<T> {
List<String> tables = locks.get(Long.parseLong(lda[1], 16));
if (tables == null) {
- tables = new ArrayList<String>();
+ tables = new ArrayList<>();
locks.put(Long.parseLong(lda[1], 16), tables);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<T> implements TStore<T> {
}
public void ageOff() {
- HashSet<Long> oldTxs = new HashSet<Long>();
+ HashSet<Long> oldTxs = new HashSet<>();
synchronized (this) {
long time = timeSource.currentTimeMillis();
@@ -114,7 +114,7 @@ public class AgeOffStore<T> implements TStore<T> {
this.store = store;
this.ageOffTime = ageOffTime;
this.timeSource = timeSource;
- candidates = new HashMap<Long,Long>();
+ candidates = new HashMap<>();
minTime = Long.MAX_VALUE;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<T> implements ReadOnlyTStore<T> {
@Override
public ReadOnlyRepo<T> top(long tid) {
- return new ReadOnlyRepoWrapper<T>(store.top(tid));
+ return new ReadOnlyRepoWrapper<>(store.top(tid));
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<T> implements TStore<T> {
this.path = path;
this.zk = zk;
- this.reserved = new HashSet<Long>();
- this.defered = new HashMap<Long,Long>();
+ 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<T> implements TStore<T> {
events = statusChangeEvents;
}
- List<String> txdirs = new ArrayList<String>(zk.getChildren(path));
+ List<String> txdirs = new ArrayList<>(zk.getChildren(path));
Collections.sort(txdirs);
synchronized (this) {
@@ -287,7 +287,7 @@ public class ZooStore<T> implements TStore<T> {
private String findTop(String txpath) throws KeeperException, InterruptedException {
List<String> ops = zk.getChildren(txpath);
- ops = new ArrayList<String>(ops);
+ ops = new ArrayList<>(ops);
String max = "";
@@ -448,7 +448,7 @@ public class ZooStore<T> implements TStore<T> {
@Override
public List<Long> list() {
try {
- ArrayList<Long> l = new ArrayList<Long>();
+ ArrayList<Long> l = new ArrayList<>();
List<String> transactions = zk.getChildren(path);
for (String txid : transactions) {
l.add(parseTid(txid));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Long,AtomicInteger> counts = new HashMap<Long,AtomicInteger>();
+ final private Map<Long,AtomicInteger> counts = new HashMap<>();
final private Arbitrator arbitrator;
public TransactionWatcher(Arbitrator arbitrator) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String,byte[]>();
- this.statCache = new HashMap<String,Stat>();
- this.childrenCache = new HashMap<String,List<String>>();
+ 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/717febbf/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<String,ZooCache> instances = new HashMap<String,ZooCache>();
+ private static Map<String,ZooCache> 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/717febbf/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<String>(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<String>(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<String>(children);
+ children = new ArrayList<>(children);
Collections.sort(children);
String lockNode = children.get(0);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<Long,byte[]> getEarlierEntries(long entry) {
- SortedMap<Long,byte[]> result = new TreeMap<Long,byte[]>();
+ SortedMap<Long,byte[]> result = new TreeMap<>();
try {
List<String> children = Collections.emptyList();
try {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String,ZooSessionInfo> sessions = new HashMap<String,ZooSessionInfo>();
+ private static Map<String,ZooSessionInfo> 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/717febbf/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<ACL>();
+ PRIVATE = new ArrayList<>();
PRIVATE.addAll(Ids.CREATOR_ALL_ACL);
- PUBLIC = new ArrayList<ACL>();
+ 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<String>(children);
+ children = new ArrayList<>(children);
Collections.sort(children);
String lockNode = children.get(0);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> sstore = new SimpleStore<String>();
- AgeOffStore<String> aoStore = new AgeOffStore<String>(sstore, 10, tts);
+ SimpleStore<String> sstore = new SimpleStore<>();
+ AgeOffStore<String> aoStore = new AgeOffStore<>(sstore, 10, tts);
aoStore.ageOff();
@@ -73,22 +73,22 @@ public class AgeOffStoreTest {
aoStore.ageOff();
- Assert.assertEquals(new HashSet<Long>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(4, new HashSet<Long>(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<Long>(Arrays.asList(txid1, txid3, txid4)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(3, new HashSet<Long>(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<Long>(Arrays.asList(txid1)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(1, new HashSet<Long>(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<String> sstore = new SimpleStore<String>();
+ SimpleStore<String> 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<String> aoStore = new AgeOffStore<String>(sstore, 10, tts);
+ AgeOffStore<String> aoStore = new AgeOffStore<>(sstore, 10, tts);
- Assert.assertEquals(new HashSet<Long>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(4, new HashSet<Long>(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<Long>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(4, new HashSet<Long>(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<Long>(Arrays.asList(txid1)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(1, new HashSet<Long>(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<Long>(Arrays.asList(txid1)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(1, new HashSet<Long>(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<Long>(Arrays.asList(txid1)), new HashSet<Long>(aoStore.list()));
- Assert.assertEquals(1, new HashSet<Long>(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<Long>(aoStore.list()).size());
+ Assert.assertEquals(0, new HashSet<>(aoStore.list()).size());
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/717febbf/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<String> store = new ReadOnlyStore<String>(mock);
+ ReadOnlyTStore<String> store = new ReadOnlyStore<>(mock);
Assert.assertEquals(0xdeadbeefl, store.reserve());
store.reserve(0xdeadbeefl);
ReadOnlyRepo<String> top = store.top(0xdeadbeefl);