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/07/01 01:59:22 UTC
[25/32] accumulo git commit: ACCUMULO-4357 Remove unneeded code for
readability
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
index 0c4ffa2..61d98e6 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/FilterTest.java
@@ -48,8 +48,8 @@ import org.junit.Test;
public class FilterTest {
- private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
- private static final Map<String,String> EMPTY_OPTS = new HashMap<String,String>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
+ private static final Map<String,String> EMPTY_OPTS = new HashMap<>();
public static class SimpleFilter extends Filter {
@Override
@@ -85,7 +85,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
for (int i = 0; i < 1000; i++) {
Key k = new Key(new Text(String.format("%03d", i)), colf, colq);
@@ -120,7 +120,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
for (int i = 0; i < 1000; i++) {
Key k = new Key(new Text(String.format("%03d", i)), colf, colq);
@@ -157,7 +157,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
for (int i = 0; i < 1000; i++) {
Key k = new Key(new Text(String.format("%03d", i)), colf, colq);
@@ -185,7 +185,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
for (int i = 0; i < 1000; i++) {
Key k = new Key(new Text(String.format("%03d", i)), colf, colq);
@@ -218,7 +218,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
IteratorSetting is = new IteratorSetting(1, ColumnAgeOffFilter.class);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("a"), 901l);
long ts = System.currentTimeMillis();
@@ -253,8 +253,8 @@ public class FilterTest {
@Test
public void test3() throws IOException {
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
- HashSet<Column> hsc = new HashSet<Column>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
+ HashSet<Column> hsc = new HashSet<>();
hsc.add(new Column("c".getBytes(), null, null));
Text colf1 = new Text("a");
@@ -281,14 +281,14 @@ public class FilterTest {
a.seek(new Range(), EMPTY_COL_FAMS, false);
assertEquals(size(a), 1000);
- hsc = new HashSet<Column>();
+ hsc = new HashSet<>();
hsc.add(new Column("a".getBytes(), "b".getBytes(), null));
a = new ColumnQualifierFilter(new SortedMapIterator(tm), hsc);
a.seek(new Range(), EMPTY_COL_FAMS, false);
int size = size(a);
assertTrue("size was " + size, size == 500);
- hsc = new HashSet<Column>();
+ hsc = new HashSet<>();
a = new ColumnQualifierFilter(new SortedMapIterator(tm), hsc);
a.seek(new Range(), EMPTY_COL_FAMS, false);
size = size(a);
@@ -298,7 +298,7 @@ public class FilterTest {
@Test
public void test4() throws IOException {
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
ColumnVisibility le1 = new ColumnVisibility("L1");
ColumnVisibility le2 = new ColumnVisibility("L0&OFFICIAL");
@@ -320,7 +320,7 @@ public class FilterTest {
}
private ColumnQualifierFilter ncqf(TreeMap<Key,Value> tm, Column... columns) throws IOException {
- HashSet<Column> hsc = new HashSet<Column>();
+ HashSet<Column> hsc = new HashSet<>();
for (Column column : columns) {
hsc.add(column);
@@ -334,7 +334,7 @@ public class FilterTest {
@Test
public void test5() throws IOException {
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
tm.put(new Key(new Text(String.format("%03d", 1)), new Text("a"), new Text("x")), dv);
tm.put(new Key(new Text(String.format("%03d", 2)), new Text("a"), new Text("y")), dv);
@@ -365,7 +365,7 @@ public class FilterTest {
@Test
public void testNoVisFilter() throws IOException {
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
Value v = new Value();
for (int i = 0; i < 1000; i++) {
Key k = new Key(String.format("%03d", i), "a", "b", i % 10 == 0 ? "vis" : "");
@@ -385,7 +385,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
for (int i = 0; i < 100; i++) {
Key k = new Key(new Text(String.format("%02d", i)), colf, colq);
@@ -482,7 +482,7 @@ public class FilterTest {
Text colf = new Text("a");
Text colq = new Text("b");
Value dv = new Value();
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
Key k = new Key(new Text("0"), colf, colq);
tm.put(k, dv);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/GrepIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/GrepIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/GrepIteratorTest.java
index 23af994..3a47f5a 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/GrepIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/GrepIteratorTest.java
@@ -38,14 +38,14 @@ import org.junit.Before;
import org.junit.Test;
public class GrepIteratorTest {
- private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
SortedMap<Key,Value> input;
SortedMap<Key,Value> output;
@Before
public void init() {
- input = new TreeMap<Key,Value>();
- output = new TreeMap<Key,Value>();
+ input = new TreeMap<>();
+ output = new TreeMap<>();
input.put(new Key("abcdef", "xyz", "xyz", 0), new Value("xyz".getBytes()));
output.put(new Key("abcdef", "xyz", "xyz", 0), new Value("xyz".getBytes()));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
index 117fcac..cb6d3f7 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
@@ -46,7 +46,7 @@ public class IndexedDocIteratorTest extends TestCase {
private static final Logger log = Logger.getLogger(IndexedDocIteratorTest.class);
- private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
private static final byte[] nullByte = {0};
private static IteratorEnvironment env = new DefaultIteratorEnvironment();
@@ -71,7 +71,7 @@ public class IndexedDocIteratorTest extends TestCase {
StringBuilder sb = new StringBuilder();
Random r = new Random();
Value v = new Value(new byte[0]);
- TreeMap<Key,Value> map = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> map = new TreeMap<>();
boolean[] negateMask = new boolean[columnFamilies.length];
for (int i = 0; i < columnFamilies.length; i++) {
@@ -189,7 +189,7 @@ public class IndexedDocIteratorTest extends TestCase {
otherColumnFamilies[3] = new Text("F");
float hitRatio = 0.5f;
- HashSet<Text> docs = new HashSet<Text>();
+ HashSet<Text> docs = new HashSet<>();
SortedKeyValueIterator<Key,Value> source = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
IteratorSetting is = new IteratorSetting(1, IndexedDocIterator.class);
IndexedDocIterator.setColumnFamilies(is, columnFamilies);
@@ -227,7 +227,7 @@ public class IndexedDocIteratorTest extends TestCase {
otherColumnFamilies[3] = new Text("F");
float hitRatio = 0.5f;
- HashSet<Text> docs = new HashSet<Text>();
+ HashSet<Text> docs = new HashSet<>();
SortedKeyValueIterator<Key,Value> source = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
IteratorSetting is = new IteratorSetting(1, IndexedDocIterator.class);
IndexedDocIterator.setColumnFamilies(is, columnFamilies);
@@ -264,10 +264,10 @@ public class IndexedDocIteratorTest extends TestCase {
otherColumnFamilies[3] = new Text("F");
float hitRatio = 0.5f;
- HashSet<Text> docs = new HashSet<Text>();
+ HashSet<Text> docs = new HashSet<>();
SortedKeyValueIterator<Key,Value> source = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
SortedKeyValueIterator<Key,Value> source2 = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
- ArrayList<SortedKeyValueIterator<Key,Value>> sourceIters = new ArrayList<SortedKeyValueIterator<Key,Value>>();
+ ArrayList<SortedKeyValueIterator<Key,Value>> sourceIters = new ArrayList<>();
sourceIters.add(source);
sourceIters.add(source2);
MultiIterator mi = new MultiIterator(sourceIters, false);
@@ -310,7 +310,7 @@ public class IndexedDocIteratorTest extends TestCase {
otherColumnFamilies[3] = new Text("F");
float hitRatio = 0.5f;
- HashSet<Text> docs = new HashSet<Text>();
+ HashSet<Text> docs = new HashSet<>();
SortedKeyValueIterator<Key,Value> source = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs, negatedColumns);
IteratorSetting is = new IteratorSetting(1, IndexedDocIterator.class);
IndexedDocIterator.setColumnFamilies(is, columnFamilies, notFlags);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
index 700f93b..aad2e54 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
@@ -42,11 +42,11 @@ import org.junit.rules.TestName;
public class IntersectingIteratorTest {
- private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
private static IteratorEnvironment env = new DefaultIteratorEnvironment();
TreeMap<Key,Value> map;
- HashSet<Text> docs = new HashSet<Text>();
+ HashSet<Text> docs = new HashSet<>();
Text[] columnFamilies;
Text[] negatedColumns;
Text[] otherColumnFamilies;
@@ -59,7 +59,7 @@ public class IntersectingIteratorTest {
HashSet<Text> docs, Text[] negatedColumns) {
Random r = new Random();
Value v = new Value(new byte[0]);
- TreeMap<Key,Value> map = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> map = new TreeMap<>();
boolean[] negateMask = new boolean[columnFamilies.length];
for (int i = 0; i < columnFamilies.length; i++) {
@@ -198,7 +198,7 @@ public class IntersectingIteratorTest {
float hitRatio = 0.5f;
SortedKeyValueIterator<Key,Value> source = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
SortedKeyValueIterator<Key,Value> source2 = createIteratorStack(hitRatio, NUM_ROWS, NUM_DOCIDS, columnFamilies, otherColumnFamilies, docs);
- ArrayList<SortedKeyValueIterator<Key,Value>> sourceIters = new ArrayList<SortedKeyValueIterator<Key,Value>>();
+ ArrayList<SortedKeyValueIterator<Key,Value>> sourceIters = new ArrayList<>();
sourceIters.add(source);
sourceIters.add(source2);
MultiIterator mi = new MultiIterator(sourceIters, false);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
index af610ca..1d5a108 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
@@ -66,18 +66,18 @@ public class LargeRowFilterTest extends TestCase {
}
public void testBasic() throws Exception {
- TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> testData = new TreeMap<>();
genTestData(testData, 20);
for (int i = 1; i <= 20; i++) {
- TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> expectedData = new TreeMap<>();
genTestData(expectedData, i);
LargeRowFilter lrfi = setupIterator(testData, i, IteratorScope.scan);
lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
- TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> filteredData = new TreeMap<>();
while (lrfi.hasTop()) {
filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
@@ -89,17 +89,17 @@ public class LargeRowFilterTest extends TestCase {
}
public void testSeek() throws Exception {
- TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> testData = new TreeMap<>();
genTestData(testData, 20);
for (int i = 1; i <= 20; i++) {
- TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> expectedData = new TreeMap<>();
genTestData(expectedData, i);
LargeRowFilter lrfi = setupIterator(testData, i, IteratorScope.scan);
- TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> filteredData = new TreeMap<>();
// seek to each row... rows that exceed max columns should be filtered
for (int j = 1; j <= i; j++) {
@@ -117,7 +117,7 @@ public class LargeRowFilterTest extends TestCase {
}
public void testSeek2() throws Exception {
- TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> testData = new TreeMap<>();
genTestData(testData, 20);
@@ -130,10 +130,10 @@ public class LargeRowFilterTest extends TestCase {
lrfi.seek(new Range(new Key(genRow(10), "cf001", genCQ(4), 5), true, new Key(genRow(10)).followingKey(PartialKey.ROW), false),
LocalityGroupUtil.EMPTY_CF_SET, false);
- TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> expectedData = new TreeMap<>();
genRow(expectedData, 10, 4, 10);
- TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> filteredData = new TreeMap<>();
while (lrfi.hasTop()) {
filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
lrfi.next();
@@ -143,14 +143,14 @@ public class LargeRowFilterTest extends TestCase {
}
public void testCompaction() throws Exception {
- TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> testData = new TreeMap<>();
genTestData(testData, 20);
LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.majc);
lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
- TreeMap<Key,Value> compactedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> compactedData = new TreeMap<>();
while (lrfi.hasTop()) {
compactedData.put(lrfi.getTopKey(), lrfi.getTopValue());
lrfi.next();
@@ -167,10 +167,10 @@ public class LargeRowFilterTest extends TestCase {
lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
// only expect to see 13 rows
- TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> expectedData = new TreeMap<>();
genTestData(expectedData, 13);
- TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> filteredData = new TreeMap<>();
while (lrfi.hasTop()) {
filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
lrfi.next();
@@ -185,7 +185,7 @@ public class LargeRowFilterTest extends TestCase {
assertFalse(lrfi.hasTop());
// test seeking w/ column families
- HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> colfams = new HashSet<>();
colfams.add(new ArrayByteSequence("cf001"));
lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true, new Key(genRow(15)).followingKey(PartialKey.ROW), false), colfams, true);
assertFalse(lrfi.hasTop());
@@ -194,20 +194,20 @@ public class LargeRowFilterTest extends TestCase {
// in other test data is generated in such a way that once a row
// is suppressed, all subsequent rows are suppressed
public void testSuppressInner() throws Exception {
- TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> testData = new TreeMap<>();
genRow(testData, 1, 0, 2);
genRow(testData, 2, 0, 50);
genRow(testData, 3, 0, 15);
genRow(testData, 4, 0, 5);
- TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> expectedData = new TreeMap<>();
genRow(expectedData, 1, 0, 2);
genRow(expectedData, 4, 0, 5);
LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.scan);
lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
- TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> filteredData = new TreeMap<>();
while (lrfi.hasTop()) {
filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
lrfi.next();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
index 61acc09..f31514a 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
@@ -37,7 +37,7 @@ import org.junit.Test;
public class RegExFilterTest {
- private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
+ private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<>();
private Key nkv(TreeMap<Key,Value> tm, String row, String cf, String cq, String val) {
Key k = nk(row, cf, cq);
@@ -51,7 +51,7 @@ public class RegExFilterTest {
@Test
public void test1() throws IOException {
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
Key k1 = nkv(tm, "boo1", "yup", "20080201", "dog");
Key k2 = nkv(tm, "boo1", "yap", "20080202", "cat");
@@ -242,7 +242,7 @@ public class RegExFilterTest {
@Test
public void testNullByteInKey() throws IOException {
- TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm = new TreeMap<>();
String s1 = "first", s2 = "second";
byte[] b1 = s1.getBytes(), b2 = s2.getBytes(), ball;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
index bdaf112..4ec0269 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
@@ -76,7 +76,7 @@ public class RowDeletingIteratorTest extends TestCase {
public void test1() throws Exception {
- TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm1 = new TreeMap<>();
put(tm1, "r1", "", "", 10, RowDeletingIterator.DELETE_ROW_VALUE);
put(tm1, "r1", "cf1", "cq1", 5, "v1");
put(tm1, "r1", "cf1", "cq3", 5, "v1");
@@ -115,7 +115,7 @@ public class RowDeletingIteratorTest extends TestCase {
public void test2() throws Exception {
- TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm1 = new TreeMap<>();
put(tm1, "r1", "", "", 10, RowDeletingIterator.DELETE_ROW_VALUE);
put(tm1, "r1", "cf1", "cq1", 5, "v1");
put(tm1, "r1", "cf1", "cq3", 15, "v1");
@@ -156,7 +156,7 @@ public class RowDeletingIteratorTest extends TestCase {
public void test3() throws Exception {
- TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm1 = new TreeMap<>();
put(tm1, "r1", "", "", 10, RowDeletingIterator.DELETE_ROW_VALUE);
put(tm1, "r1", "", "cq1", 5, "v1");
put(tm1, "r1", "cf1", "cq1", 5, "v1");
@@ -166,7 +166,7 @@ public class RowDeletingIteratorTest extends TestCase {
RowDeletingIterator rdi = new RowDeletingIterator();
rdi.init(new ColumnFamilySkippingIterator(new SortedMapIterator(tm1)), null, new TestIE(IteratorScope.scan, false));
- HashSet<ByteSequence> cols = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> cols = new HashSet<>();
cols.add(new ArrayByteSequence("cf1".getBytes()));
rdi.seek(new Range(), cols, true);
@@ -186,7 +186,7 @@ public class RowDeletingIteratorTest extends TestCase {
public void test4() throws Exception {
- TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tm1 = new TreeMap<>();
put(tm1, "r1", "", "", 10, RowDeletingIterator.DELETE_ROW_VALUE);
put(tm1, "r1", "cf1", "cq1", 5, "v1");
put(tm1, "r1", "cf1", "cq3", 15, "v1");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/RowEncodingIteratorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowEncodingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowEncodingIteratorTest.java
index d9aa174..d531517 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowEncodingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowEncodingIteratorTest.java
@@ -62,9 +62,9 @@ public class RowEncodingIteratorTest {
public static SortedMap<Key,Value> decodeRow(Key rowKey, Value rowValue) throws IOException {
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(rowValue.get()));
int numKeys = dis.readInt();
- List<Key> decodedKeys = new ArrayList<Key>();
- List<Value> decodedValues = new ArrayList<Value>();
- SortedMap<Key,Value> out = new TreeMap<Key,Value>();
+ List<Key> decodedKeys = new ArrayList<>();
+ List<Value> decodedValues = new ArrayList<>();
+ SortedMap<Key,Value> out = new TreeMap<>();
for (int i = 0; i < numKeys; i++) {
Key k = new Key();
k.readFields(dis);
@@ -115,26 +115,26 @@ public class RowEncodingIteratorTest {
public void testEncodeAll() throws IOException {
byte[] kbVal = new byte[1024];
// This code is shamelessly borrowed from the WholeRowIteratorTest.
- SortedMap<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, kbVal);
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, kbVal);
- SortedMap<Key,Value> map2 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map2 = new TreeMap<>();
pkv(map2, "row2", "cf1", "cq1", "cv1", 5, kbVal);
pkv(map2, "row2", "cf1", "cq2", "cv1", 6, kbVal);
- SortedMap<Key,Value> map3 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map3 = new TreeMap<>();
pkv(map3, "row3", "cf1", "cq1", "cv1", 5, kbVal);
pkv(map3, "row3", "cf1", "cq2", "cv1", 6, kbVal);
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map = new TreeMap<>();
map.putAll(map1);
map.putAll(map2);
map.putAll(map3);
SortedMapIterator src = new SortedMapIterator(map);
Range range = new Range(new Text("row1"), true, new Text("row2"), true);
RowEncodingIteratorImpl iter = new RowEncodingIteratorImpl();
- Map<String,String> bigBufferOpts = new HashMap<String,String>();
+ Map<String,String> bigBufferOpts = new HashMap<>();
bigBufferOpts.put(RowEncodingIterator.MAX_BUFFER_SIZE_OPT, "3K");
iter.init(src, bigBufferOpts, new DummyIteratorEnv());
iter.seek(range, new ArrayList<ByteSequence>(), false);
@@ -159,16 +159,16 @@ public class RowEncodingIteratorTest {
public void testEncodeSome() throws IOException {
byte[] kbVal = new byte[1024];
// This code is shamelessly borrowed from the WholeRowIteratorTest.
- SortedMap<Key,Value> map1 = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map1 = new TreeMap<>();
pkv(map1, "row1", "cf1", "cq1", "cv1", 5, kbVal);
pkv(map1, "row1", "cf1", "cq2", "cv1", 6, kbVal);
- SortedMap<Key,Value> map = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> map = new TreeMap<>();
map.putAll(map1);
SortedMapIterator src = new SortedMapIterator(map);
Range range = new Range(new Text("row1"), true, new Text("row2"), true);
RowEncodingIteratorImpl iter = new RowEncodingIteratorImpl();
- Map<String,String> bigBufferOpts = new HashMap<String,String>();
+ Map<String,String> bigBufferOpts = new HashMap<>();
bigBufferOpts.put(RowEncodingIterator.MAX_BUFFER_SIZE_OPT, "1K");
iter.init(src, bigBufferOpts, new DummyIteratorEnv());
iter.seek(range, new ArrayList<ByteSequence>(), false);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
index f0892b2..4294eb3 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
@@ -83,7 +83,7 @@ public class RowFilterTest {
}
public static class RowZeroOrOneFilter extends RowFilter {
- private static final Set<String> passRows = new HashSet<String>(Arrays.asList("0", "1"));
+ private static final Set<String> passRows = new HashSet<>(Arrays.asList("0", "1"));
@Override
public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException {
@@ -92,7 +92,7 @@ public class RowFilterTest {
}
public static class RowOneOrTwoFilter extends RowFilter {
- private static final Set<String> passRows = new HashSet<String>(Arrays.asList("1", "2"));
+ private static final Set<String> passRows = new HashSet<>(Arrays.asList("1", "2"));
@Override
public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException {
@@ -108,7 +108,7 @@ public class RowFilterTest {
}
public List<Mutation> createMutations() {
- List<Mutation> mutations = new LinkedList<Mutation>();
+ List<Mutation> mutations = new LinkedList<>();
Mutation m = new Mutation("0");
m.put("cf1", "cq1", "1");
m.put("cf1", "cq2", "1");
@@ -157,7 +157,7 @@ public class RowFilterTest {
public TreeMap<Key,Value> createKeyValues() {
List<Mutation> mutations = createMutations();
- TreeMap<Key,Value> keyValues = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> keyValues = new TreeMap<>();
final Text cf = new Text(), cq = new Text();
for (Mutation m : mutations) {
@@ -185,24 +185,24 @@ public class RowFilterTest {
filter.seek(new Range(), Collections.<ByteSequence> emptySet(), false);
- assertEquals(new HashSet<String>(Arrays.asList("2", "3")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("2", "3")), getRows(filter));
ByteSequence cf = new ArrayByteSequence("cf2");
filter.seek(new Range(), ImmutableSet.of(cf), true);
- assertEquals(new HashSet<String>(Arrays.asList("1", "3", "0", "4")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("1", "3", "0", "4")), getRows(filter));
filter.seek(new Range("0", "4"), Collections.<ByteSequence> emptySet(), false);
- assertEquals(new HashSet<String>(Arrays.asList("2", "3")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("2", "3")), getRows(filter));
filter.seek(new Range("2"), Collections.<ByteSequence> emptySet(), false);
- assertEquals(new HashSet<String>(Arrays.asList("2")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("2")), getRows(filter));
filter.seek(new Range("4"), Collections.<ByteSequence> emptySet(), false);
assertEquals(new HashSet<String>(), getRows(filter));
filter.seek(new Range("4"), ImmutableSet.of(cf), true);
- assertEquals(new HashSet<String>(Arrays.asList("4")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("4")), getRows(filter));
}
@@ -218,7 +218,7 @@ public class RowFilterTest {
filter.seek(new Range(), Collections.<ByteSequence> emptySet(), false);
- assertEquals(new HashSet<String>(Arrays.asList("0", "1", "2", "3", "4")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("0", "1", "2", "3", "4")), getRows(filter));
}
@Test
@@ -234,7 +234,7 @@ public class RowFilterTest {
filter.seek(new Range(), Collections.<ByteSequence> emptySet(), false);
- assertEquals(new HashSet<String>(Arrays.asList("1")), getRows(filter));
+ assertEquals(new HashSet<>(Arrays.asList("1")), getRows(filter));
}
@Test
@@ -284,7 +284,7 @@ public class RowFilterTest {
}
private HashSet<String> getRows(RowFilter filter) throws IOException {
- HashSet<String> rows = new HashSet<String>();
+ HashSet<String> rows = new HashSet<>();
while (filter.hasTop()) {
rows.add(filter.getTopKey().getRowData().toString());
filter.next();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
index d379778..20d9bcb 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
@@ -109,7 +109,7 @@ public abstract class TestCfCqSlice {
assertTrue("slice param must be less than LR_DIM", sliceMinCq < LR_DIM);
assertTrue("slice param must be less than LR_DIM", sliceMaxCf < LR_DIM);
assertTrue("slice param must be less than LR_DIM", sliceMaxCq < LR_DIM);
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CF, new String(LONG_LEX.encode(sliceMinCf), UTF_8));
opts.put(CfCqSliceOpts.OPT_MIN_CQ, new String(LONG_LEX.encode(sliceMinCq), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CF, new String(LONG_LEX.encode(sliceMaxCf), UTF_8));
@@ -135,7 +135,7 @@ public abstract class TestCfCqSlice {
long sliceMinCq = 20;
long sliceMaxCf = 20;
long sliceMaxCq = 20;
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CF, new String(LONG_LEX.encode(sliceMinCf), UTF_8));
opts.put(CfCqSliceOpts.OPT_MIN_CQ, new String(LONG_LEX.encode(sliceMinCq), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CF, new String(LONG_LEX.encode(sliceMaxCf), UTF_8));
@@ -161,7 +161,7 @@ public abstract class TestCfCqSlice {
long sliceMinCq = 20;
long sliceMaxCf = 22;
long sliceMaxCq = 22;
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CF, new String(LONG_LEX.encode(sliceMinCf), UTF_8));
opts.put(CfCqSliceOpts.OPT_MIN_CQ, new String(LONG_LEX.encode(sliceMinCq), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CF, new String(LONG_LEX.encode(sliceMaxCf), UTF_8));
@@ -187,7 +187,7 @@ public abstract class TestCfCqSlice {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCq = 10;
long sliceMaxCq = 30;
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CQ, new String(LONG_LEX.encode(sliceMinCq), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CQ, new String(LONG_LEX.encode(sliceMaxCq), UTF_8));
loadKvs(foundKvs, opts, INFINITY);
@@ -209,7 +209,7 @@ public abstract class TestCfCqSlice {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 10;
long sliceMaxCf = 30;
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CF, new String(LONG_LEX.encode(sliceMinCf), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CF, new String(LONG_LEX.encode(sliceMaxCf), UTF_8));
loadKvs(foundKvs, opts, INFINITY);
@@ -233,7 +233,7 @@ public abstract class TestCfCqSlice {
long sliceMinCq = LR_DIM + 1;
long sliceMaxCf = LR_DIM + 1;
long sliceMaxCq = LR_DIM + 1;
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
opts.put(CfCqSliceOpts.OPT_MIN_CF, new String(LONG_LEX.encode(sliceMinCf), UTF_8));
opts.put(CfCqSliceOpts.OPT_MIN_CQ, new String(LONG_LEX.encode(sliceMinCq), UTF_8));
opts.put(CfCqSliceOpts.OPT_MAX_CF, new String(LONG_LEX.encode(sliceMaxCf), UTF_8));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 97ebe5c..d02b7f2 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
@@ -64,7 +64,7 @@ public class TransformingIteratorTest {
private static final Map<String,String> EMPTY_OPTS = ImmutableMap.of();
private TransformingIterator titer;
- private TreeMap<Key,Value> data = new TreeMap<Key,Value>();
+ private TreeMap<Key,Value> data = new TreeMap<>();
@Before
public void createData() throws Exception {
@@ -113,7 +113,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) {
@@ -129,7 +129,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);
@@ -140,7 +140,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) {
@@ -166,7 +166,7 @@ public class TransformingIteratorTest {
// Make sure it shows up in the output with the default test auths which include
// vis0.
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) {
@@ -194,7 +194,7 @@ public class TransformingIteratorTest {
public void testRangeStart() throws Exception {
setUpTransformIterator(ColVisReversingKeyTransformingIterator.class);
- 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);
@@ -205,7 +205,7 @@ public class TransformingIteratorTest {
public void testRangeEnd() throws Exception {
setUpTransformIterator(ColVisReversingKeyTransformingIterator.class);
- 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 {
// the data with untransformed col fam cf3 will transform to cf0 and
// be inside the range.
- 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);
@@ -266,7 +266,7 @@ public class TransformingIteratorTest {
int expectedCF = 1;
setUpTransformIterator(ColFamReversingKeyTransformingIterator.class);
- 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)
@@ -317,7 +317,7 @@ public class TransformingIteratorTest {
int expectedCF = 1;
setUpTransformIterator(ColFamReversingCompactionKeyTransformingIterator.class);
- 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)
@@ -332,7 +332,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) {
@@ -391,7 +391,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()));
@@ -583,7 +583,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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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 6fe240a..b7804f6 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/b102e760/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/b102e760/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/b102e760/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 505c198..22af5b0 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/b102e760/core/src/test/java/org/apache/accumulo/core/util/format/DefaultFormatterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/DefaultFormatterTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/DefaultFormatterTest.java
index eed455c..9c688db 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/format/DefaultFormatterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/format/DefaultFormatterTest.java
@@ -68,7 +68,7 @@ public class DefaultFormatterTest {
@Test
public void testFormatEntry() {
final long timestamp = 0;
- Map<Key,Value> map = new TreeMap<Key,Value>();
+ Map<Key,Value> map = new TreeMap<>();
map.put(new Key("a", "ab", "abc", timestamp), new Value("abcd".getBytes()));
FormatterConfig config;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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 7f20dfc..c267fbe 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/b102e760/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 d6afe99..ce733fe 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/b102e760/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 69342d7..d559d73 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/b102e760/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/b102e760/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 610eb5c..51aee8f 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,12 +156,12 @@ 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()) {
String tableId = ke.getKey().getTableId().toString();
Set<SecurityErrorCode> secCodes = tables.get(tableId);
if (secCodes == null) {
- secCodes = new HashSet<SecurityErrorCode>();
+ secCodes = new HashSet<>();
tables.put(tableId, secCodes);
}
secCodes.addAll(ke.getValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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/b102e760/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 1005df4..b0b5177 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/b102e760/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));
}