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:13 UTC
[16/32] accumulo git commit: ACCUMULO-4357 Remove unneeded code for
readability
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
index 69cf23c..dea1b7f 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
@@ -119,7 +119,7 @@ public class CollectTabletStats {
System.exit(-1);
}
- TreeMap<KeyExtent,String> tabletLocations = new TreeMap<KeyExtent,String>();
+ TreeMap<KeyExtent,String> tabletLocations = new TreeMap<>();
List<KeyExtent> candidates = findTablets(context, !opts.selectFarTablets, opts.getTableName(), tabletLocations);
if (candidates.size() < opts.numThreads) {
@@ -129,7 +129,7 @@ public class CollectTabletStats {
List<KeyExtent> tabletsToTest = selectRandomTablets(opts.numThreads, candidates);
- Map<KeyExtent,List<FileRef>> tabletFiles = new HashMap<KeyExtent,List<FileRef>>();
+ Map<KeyExtent,List<FileRef>> tabletFiles = new HashMap<>();
for (KeyExtent ke : tabletsToTest) {
List<FileRef> files = getTabletFiles(context, tableId, ke);
@@ -155,7 +155,7 @@ public class CollectTabletStats {
for (int i = 0; i < opts.iterations; i++) {
- ArrayList<Test> tests = new ArrayList<Test>();
+ ArrayList<Test> tests = new ArrayList<>();
for (final KeyExtent ke : tabletsToTest) {
final List<FileRef> files = tabletFiles.get(ke);
@@ -175,7 +175,7 @@ public class CollectTabletStats {
for (int i = 0; i < opts.iterations; i++) {
- ArrayList<Test> tests = new ArrayList<Test>();
+ ArrayList<Test> tests = new ArrayList<>();
for (final KeyExtent ke : tabletsToTest) {
final List<FileRef> files = tabletFiles.get(ke);
@@ -193,7 +193,7 @@ public class CollectTabletStats {
}
for (int i = 0; i < opts.iterations; i++) {
- ArrayList<Test> tests = new ArrayList<Test>();
+ ArrayList<Test> tests = new ArrayList<>();
for (final KeyExtent ke : tabletsToTest) {
final List<FileRef> files = tabletFiles.get(ke);
@@ -212,7 +212,7 @@ public class CollectTabletStats {
for (int i = 0; i < opts.iterations; i++) {
- ArrayList<Test> tests = new ArrayList<Test>();
+ ArrayList<Test> tests = new ArrayList<>();
final Connector conn = opts.getConnector();
@@ -354,7 +354,7 @@ public class CollectTabletStats {
InetAddress localaddress = InetAddress.getLocalHost();
- List<KeyExtent> candidates = new ArrayList<KeyExtent>();
+ List<KeyExtent> candidates = new ArrayList<>();
for (Entry<KeyExtent,String> entry : tabletLocations.entrySet()) {
String loc = entry.getValue();
@@ -372,7 +372,7 @@ public class CollectTabletStats {
}
private static List<KeyExtent> selectRandomTablets(int numThreads, List<KeyExtent> candidates) {
- List<KeyExtent> tabletsToTest = new ArrayList<KeyExtent>();
+ List<KeyExtent> tabletsToTest = new ArrayList<>();
Random rand = new Random();
for (int i = 0; i < numThreads; i++) {
@@ -385,7 +385,7 @@ public class CollectTabletStats {
}
private static List<FileRef> getTabletFiles(ClientContext context, String tableId, KeyExtent ke) throws IOException {
- return new ArrayList<FileRef>(MetadataTableUtil.getDataFileSizes(ke, context).keySet());
+ return new ArrayList<>(MetadataTableUtil.getDataFileSizes(ke, context).keySet());
}
private static void reportHdfsBlockLocations(List<FileRef> files) throws Exception {
@@ -423,7 +423,7 @@ public class CollectTabletStats {
SortedMapIterator smi = new SortedMapIterator(new TreeMap<Key,Value>());
- List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(mapfiles.size() + 1);
+ List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<>(mapfiles.size() + 1);
iters.addAll(mapfiles);
iters.add(smi);
@@ -462,7 +462,7 @@ public class CollectTabletStats {
}
private static HashSet<ByteSequence> createColumnBSS(String[] columns) {
- HashSet<ByteSequence> columnSet = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> columnSet = new HashSet<>();
for (String c : columns) {
columnSet.add(new ArrayByteSequence(c));
}
@@ -474,7 +474,7 @@ public class CollectTabletStats {
SortedKeyValueIterator<Key,Value> reader;
- List<SortedKeyValueIterator<Key,Value>> readers = new ArrayList<SortedKeyValueIterator<Key,Value>>(files.size());
+ List<SortedKeyValueIterator<Key,Value>> readers = new ArrayList<>(files.size());
for (FileRef file : files) {
FileSystem ns = fs.getVolumeByPath(file.path()).getFileSystem();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
index 4d4402b..63a7771 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
@@ -183,7 +183,7 @@ public class NullTserver {
@Override
public List<ActiveScan> getActiveScans(TInfo tinfo, TCredentials credentials) throws ThriftSecurityException, TException {
- return new ArrayList<ActiveScan>();
+ return new ArrayList<>();
}
@Override
@@ -206,7 +206,7 @@ public class NullTserver {
@Override
public List<ActiveCompaction> getActiveCompactions(TInfo tinfo, TCredentials credentials) throws ThriftSecurityException, TException {
- return new ArrayList<ActiveCompaction>();
+ return new ArrayList<>();
}
@Override
@@ -270,7 +270,7 @@ public class NullTserver {
MetaDataTableScanner s = new MetaDataTableScanner(context, tableRange);
long randomSessionID = opts.port;
TServerInstance instance = new TServerInstance(addr, randomSessionID);
- List<Assignment> assignments = new ArrayList<Assignment>();
+ List<Assignment> assignments = new ArrayList<>();
while (s.hasNext()) {
TabletLocationState next = s.next();
assignments.add(new Assignment(next.extent, instance));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
index 133c09c..d9a1027 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/ProxyDurabilityIT.java
@@ -96,7 +96,7 @@ public class ProxyDurabilityIT extends ConfigurableMacBase {
while (!proxyServer.isServing())
sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
Client client = new TestProxyClient("localhost", proxyPort, protocol).proxy();
- Map<String,String> properties = new TreeMap<String,String>();
+ Map<String,String> properties = new TreeMap<>();
properties.put("password", ROOT_PASSWORD);
ByteBuffer login = client.login("root", properties);
@@ -107,7 +107,7 @@ public class ProxyDurabilityIT extends ConfigurableMacBase {
WriterOptions options = new WriterOptions();
options.setDurability(Durability.NONE);
String writer = client.createWriter(login, tableName, options);
- Map<ByteBuffer,List<ColumnUpdate>> cells = new TreeMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> cells = new TreeMap<>();
ColumnUpdate column = new ColumnUpdate(bytes("cf"), bytes("cq"));
column.setValue("value".getBytes());
cells.put(bytes("row"), Collections.singletonList(column));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java b/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
index a972443..cfb572d 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java
@@ -451,7 +451,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
@Test(expected = AccumuloSecurityException.class, timeout = 5000)
public void setLocalityGroupsLoginFailure() throws Exception {
- Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
+ Map<String,Set<String>> groups = new HashMap<>();
groups.put("group1", Collections.singleton("cf1"));
groups.put("group2", Collections.singleton("cf2"));
client.setLocalityGroups(badLogin, tableName, groups);
@@ -523,7 +523,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
@Test(expected = AccumuloSecurityException.class, timeout = 5000)
public void changeUserAuthorizationsLoginFailure() throws Exception {
- HashSet<ByteBuffer> auths = new HashSet<ByteBuffer>(Arrays.asList(s2bb("A"), s2bb("B")));
+ HashSet<ByteBuffer> auths = new HashSet<>(Arrays.asList(s2bb("A"), s2bb("B")));
client.changeUserAuthorizations(badLogin, "stooge", auths);
}
@@ -1236,7 +1236,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
t.start();
// look for the scan many times
- List<ActiveScan> scans = new ArrayList<ActiveScan>();
+ List<ActiveScan> scans = new ArrayList<>();
for (int i = 0; i < 100 && scans.isEmpty(); i++) {
for (String tserver : client.getTabletServers(creds)) {
List<ActiveScan> scansForServer = client.getActiveScans(creds, tserver);
@@ -1323,7 +1323,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
assertNotNull(desiredTableId);
// try to catch it in the act
- List<ActiveCompaction> compactions = new ArrayList<ActiveCompaction>();
+ List<ActiveCompaction> compactions = new ArrayList<>();
for (int i = 0; i < 100 && compactions.isEmpty(); i++) {
// Iterate over the tservers
for (String tserver : client.getTabletServers(creds)) {
@@ -1392,12 +1392,12 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
client.createLocalUser(creds, user, password);
// change auths
Set<String> users = client.listLocalUsers(creds);
- Set<String> expectedUsers = new HashSet<String>(Arrays.asList(clientPrincipal, user));
+ Set<String> expectedUsers = new HashSet<>(Arrays.asList(clientPrincipal, user));
assertTrue("Did not find all expected users: " + expectedUsers, users.containsAll(expectedUsers));
- HashSet<ByteBuffer> auths = new HashSet<ByteBuffer>(Arrays.asList(s2bb("A"), s2bb("B")));
+ HashSet<ByteBuffer> auths = new HashSet<>(Arrays.asList(s2bb("A"), s2bb("B")));
client.changeUserAuthorizations(creds, user, auths);
List<ByteBuffer> update = client.getUserAuthorizations(creds, user);
- assertEquals(auths, new HashSet<ByteBuffer>(update));
+ assertEquals(auths, new HashSet<>(update));
// change password
if (!isKerberosEnabled()) {
@@ -1840,7 +1840,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
@Test
public void tableMergesAndSplits() throws Exception {
// add some splits
- client.addSplits(creds, tableName, new HashSet<ByteBuffer>(Arrays.asList(s2bb("a"), s2bb("m"), s2bb("z"))));
+ client.addSplits(creds, tableName, new HashSet<>(Arrays.asList(s2bb("a"), s2bb("m"), s2bb("z"))));
List<ByteBuffer> splits = client.listSplits(creds, tableName, 1);
assertEquals(Arrays.asList(s2bb("m")), splits);
@@ -1861,7 +1861,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
@Test
public void iteratorFunctionality() throws Exception {
// iterators
- HashMap<String,String> options = new HashMap<String,String>();
+ HashMap<String,String> options = new HashMap<>();
options.put("type", "STRING");
options.put("columns", "cf");
IteratorSetting setting = new IteratorSetting(10, tableName, SummingCombiner.class.getName(), options);
@@ -1949,7 +1949,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
// Clone the table
client.cloneTable(creds, tableName, TABLE_TEST2, true, null, null);
- Set<String> tablesToScan = new HashSet<String>();
+ Set<String> tablesToScan = new HashSet<>();
tablesToScan.add(tableName);
tablesToScan.add(TABLE_TEST2);
tablesToScan.add("foo");
@@ -2027,7 +2027,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
@Test
public void localityGroups() throws Exception {
- Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
+ Map<String,Set<String>> groups = new HashMap<>();
groups.put("group1", Collections.singleton("cf1"));
groups.put("group2", Collections.singleton("cf2"));
client.setLocalityGroups(creds, tableName, groups);
@@ -2151,7 +2151,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
String cwid = client.createConditionalWriter(creds, tableName, new ConditionalWriterOptions());
- Map<ByteBuffer,ConditionalUpdates> updates = new HashMap<ByteBuffer,ConditionalUpdates>();
+ Map<ByteBuffer,ConditionalUpdates> updates = new HashMap<>();
updates.put(
s2bb("00345"),
@@ -2248,7 +2248,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
// following test w/ iterator setup should succeed
Condition iterCond = newCondition("data", "count", "3");
- Map<String,String> props = new HashMap<String,String>();
+ Map<String,String> props = new HashMap<>();
props.put("type", "STRING");
props.put("columns", "data:count");
IteratorSetting is = new IteratorSetting(1, "sumc", SummingCombiner.class.getName(), props);
@@ -2534,7 +2534,7 @@ public abstract class SimpleProxyBase extends SharedMiniClusterBase {
}
private Map<String,String> s2pp(String cf) {
- Map<String,String> toRet = new TreeMap<String,String>();
+ Map<String,String> toRet = new TreeMap<>();
toRet.put("password", cf);
return toRet;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyClient.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyClient.java b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyClient.java
index ff92795..bb03934 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyClient.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyClient.java
@@ -96,7 +96,7 @@ public class TestProxyClient {
TestProxyClient tpc = new TestProxyClient("localhost", 42424);
String principal = "root";
- Map<String,String> props = new TreeMap<String,String>();
+ Map<String,String> props = new TreeMap<>();
props.put("password", "secret");
System.out.println("Logging in");
@@ -127,7 +127,7 @@ public class TestProxyClient {
Date then = new Date();
int maxInserts = 1000000;
String format = "%1$05d";
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
for (int i = 0; i < maxInserts; i++) {
String result = String.format(format, i);
ColumnUpdate update = new ColumnUpdate(ByteBuffer.wrap(("cf" + i).getBytes(UTF_8)), ByteBuffer.wrap(("cq" + i).getBytes(UTF_8)));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyReadWrite.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyReadWrite.java b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyReadWrite.java
index 1a75fea..764a08c 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyReadWrite.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyReadWrite.java
@@ -104,7 +104,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithRange() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -140,7 +140,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithColumnFamilyOnly() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
@@ -179,7 +179,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithFullColumn() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
@@ -218,7 +218,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteBatchOneShotWithFilterIterator() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -258,7 +258,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteOneShotWithRange() throws Exception {
int maxInserts = 100000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -293,7 +293,7 @@ public class TestProxyReadWrite {
@Test
public void readWriteOneShotWithFilterIterator() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
for (int i = 0; i < maxInserts; i++) {
addMutation(mutations, String.format(format, i), "cf" + i, "cq" + i, Util.randString(10));
@@ -336,7 +336,7 @@ public class TestProxyReadWrite {
// This test takes kind of a long time. Enable it if you think you may have memory issues.
public void manyWritesAndReads() throws Exception {
int maxInserts = 1000000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$06d";
String writer = tpc.proxy().createWriter(userpass, testtable, null);
for (int i = 0; i < maxInserts; i++) {
@@ -376,7 +376,7 @@ public class TestProxyReadWrite {
@Test
public void asynchReadWrite() throws Exception {
int maxInserts = 10000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
String writer = tpc.proxy().createWriter(userpass, testtable, null);
for (int i = 0; i < maxInserts; i++) {
@@ -421,12 +421,12 @@ public class TestProxyReadWrite {
@Test
public void testVisibility() throws Exception {
- Set<ByteBuffer> auths = new HashSet<ByteBuffer>();
+ Set<ByteBuffer> auths = new HashSet<>();
auths.add(ByteBuffer.wrap("even".getBytes()));
tpc.proxy().changeUserAuthorizations(userpass, "root", auths);
int maxInserts = 10000;
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
String format = "%1$05d";
String writer = tpc.proxy().createWriter(userpass, testtable, null);
for (int i = 0; i < maxInserts; i++) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/TestProxySecurityOperations.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxySecurityOperations.java b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxySecurityOperations.java
index c2ddfb7..fa6c52e 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxySecurityOperations.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxySecurityOperations.java
@@ -130,7 +130,7 @@ public class TestProxySecurityOperations {
@Test
public void auths() throws TException {
- HashSet<ByteBuffer> newauths = new HashSet<ByteBuffer>();
+ HashSet<ByteBuffer> newauths = new HashSet<>();
newauths.add(ByteBuffer.wrap("BBR".getBytes()));
newauths.add(ByteBuffer.wrap("Barney".getBytes()));
tpc.proxy().changeUserAuthorizations(userpass, testuser, newauths);
@@ -152,7 +152,7 @@ public class TestProxySecurityOperations {
}
private Map<String,String> bb2pp(ByteBuffer cf) {
- Map<String,String> toRet = new TreeMap<String,String>();
+ Map<String,String> toRet = new TreeMap<>();
toRet.put("password", ByteBufferUtil.toString(cf));
return toRet;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyTableOperations.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyTableOperations.java b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyTableOperations.java
index e8d7b1e..404bcbe 100644
--- a/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyTableOperations.java
+++ b/test/src/main/java/org/apache/accumulo/test/proxy/TestProxyTableOperations.java
@@ -104,7 +104,7 @@ public class TestProxyTableOperations {
// This test does not yet function because the backing Mock instance does not yet support merging
@Test
public void merge() throws TException {
- Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
+ Set<ByteBuffer> splits = new HashSet<>();
splits.add(ByteBuffer.wrap("a".getBytes()));
splits.add(ByteBuffer.wrap("c".getBytes()));
splits.add(ByteBuffer.wrap("z".getBytes()));
@@ -124,7 +124,7 @@ public class TestProxyTableOperations {
@Test
public void splits() throws TException {
- Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
+ Set<ByteBuffer> splits = new HashSet<>();
splits.add(ByteBuffer.wrap("a".getBytes()));
splits.add(ByteBuffer.wrap("b".getBytes()));
splits.add(ByteBuffer.wrap("z".getBytes()));
@@ -149,11 +149,11 @@ public class TestProxyTableOperations {
@Test
public void localityGroups() throws TException {
- Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
- Set<String> group1 = new HashSet<String>();
+ Map<String,Set<String>> groups = new HashMap<>();
+ Set<String> group1 = new HashSet<>();
group1.add("cf1");
groups.put("group1", group1);
- Set<String> group2 = new HashSet<String>();
+ Set<String> group2 = new HashSet<>();
group2.add("cf2");
group2.add("cf3");
groups.put("group2", group2);
@@ -187,7 +187,7 @@ public class TestProxyTableOperations {
@Test
public void tableOperationsRowMethods() throws TException {
- Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<ByteBuffer,List<ColumnUpdate>>();
+ Map<ByteBuffer,List<ColumnUpdate>> mutations = new HashMap<>();
for (int i = 0; i < 10; i++) {
addMutation(mutations, "" + i, "cf", "cq", "");
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
index f5b721b..fd5d5fa 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Framework.java
@@ -29,7 +29,7 @@ import com.beust.jcommander.Parameter;
public class Framework {
private static final Logger log = Logger.getLogger(Framework.class);
- private HashMap<String,Node> nodes = new HashMap<String,Node>();
+ private HashMap<String,Node> nodes = new HashMap<>();
private String configDir = null;
private static final Framework INSTANCE = new Framework();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
index e5af8e6..37b0417 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
@@ -116,8 +116,8 @@ public class Module extends Node {
}
}
- private HashMap<String,Node> nodes = new HashMap<String,Node>();
- private HashMap<String,Properties> localProps = new HashMap<String,Properties>();
+ private HashMap<String,Node> nodes = new HashMap<>();
+ private HashMap<String,Properties> localProps = new HashMap<>();
private class Edge {
String nodeId;
@@ -126,7 +126,7 @@ public class Module extends Node {
private class AdjList {
- private List<Edge> edges = new ArrayList<Edge>();
+ private List<Edge> edges = new ArrayList<>();
private int totalWeight = 0;
private Random rand = new Random();
@@ -167,9 +167,9 @@ public class Module extends Node {
}
}
- private HashMap<String,String> prefixes = new HashMap<String,String>();
- private HashMap<String,AdjList> adjMap = new HashMap<String,AdjList>();
- private HashMap<String,Set<String>> aliasMap = new HashMap<String,Set<String>>();
+ private HashMap<String,String> prefixes = new HashMap<>();
+ private HashMap<String,AdjList> adjMap = new HashMap<>();
+ private HashMap<String,Set<String>> aliasMap = new HashMap<>();
private final File xmlFile;
private String initNodeId;
private Fixture fixture = null;
@@ -275,7 +275,7 @@ public class Module extends Node {
}
// Wrap the visit of the next node in the module in a callable that returns a thrown exception
- FutureTask<Exception> task = new FutureTask<Exception>(new Callable<Exception>() {
+ FutureTask<Exception> task = new FutureTask<>(new Callable<Exception>() {
@Override
public Exception call() throws Exception {
@@ -327,7 +327,7 @@ public class Module extends Node {
log.debug(" " + entry.getKey() + ": " + entry.getValue());
}
log.debug("State information");
- for (String key : new TreeSet<String>(state.getMap().keySet())) {
+ for (String key : new TreeSet<>(state.getMap().keySet())) {
Object value = state.getMap().get(key);
String logMsg = " " + key + ": ";
if (value == null)
@@ -565,7 +565,7 @@ public class Module extends Node {
// parse aliases
NodeList aliaslist = nodeEl.getElementsByTagName("alias");
- Set<String> aliases = new TreeSet<String>();
+ Set<String> aliases = new TreeSet<>();
for (int j = 0; j < aliaslist.getLength(); j++) {
Element propEl = (Element) aliaslist.item(j);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
index 9b74ad4..d906d00 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/State.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
*/
public class State {
- private HashMap<String,Object> stateMap = new HashMap<String,Object>();
+ private HashMap<String,Object> stateMap = new HashMap<>();
/**
* Creates new empty state.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
index 79660e6..1fb8717 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/BulkPlusOne.java
@@ -45,7 +45,7 @@ public class BulkPlusOne extends BulkImportTest {
public static final int COLS = 10;
public static final int HEX_SIZE = (int) Math.ceil(Math.log(LOTS) / Math.log(16));
public static final String FMT = "r%0" + HEX_SIZE + "x";
- public static final List<Column> COLNAMES = new ArrayList<Column>();
+ public static final List<Column> COLNAMES = new ArrayList<>();
public static final Text CHECK_COLUMN_FAMILY = new Text("cf");
static {
for (int i = 0; i < COLS; i++) {
@@ -66,19 +66,19 @@ public class BulkPlusOne extends BulkImportTest {
fs.mkdirs(fail);
final int parts = rand.nextInt(10) + 1;
- TreeSet<Integer> startRows = new TreeSet<Integer>();
+ TreeSet<Integer> startRows = new TreeSet<>();
startRows.add(0);
while (startRows.size() < parts)
startRows.add(rand.nextInt(LOTS));
- List<String> printRows = new ArrayList<String>(startRows.size());
+ List<String> printRows = new ArrayList<>(startRows.size());
for (Integer row : startRows)
printRows.add(String.format(FMT, row));
String markerColumnQualifier = String.format("%07d", counter.incrementAndGet());
log.debug("preparing bulk files with start rows " + printRows + " last row " + String.format(FMT, LOTS - 1) + " marker " + markerColumnQualifier);
- List<Integer> rows = new ArrayList<Integer>(startRows);
+ List<Integer> rows = new ArrayList<>(startRows);
rows.add(LOTS);
for (int i = 0; i < parts; i++) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
index b69805d..641950e 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Split.java
@@ -28,7 +28,7 @@ public class Split extends SelectiveBulkTest {
@Override
protected void runLater(State state, Environment env) throws Exception {
- SortedSet<Text> splits = new TreeSet<Text>();
+ SortedSet<Text> splits = new TreeSet<>();
Random rand = (Random) state.get("rand");
int count = rand.nextInt(20);
for (int i = 0; i < count; i++)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
index 2727e62..dc040a6 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
@@ -41,11 +41,11 @@ public class AddSplits extends Test {
@SuppressWarnings("unchecked")
List<String> tableNames = (List<String>) state.get("tables");
- tableNames = new ArrayList<String>(tableNames);
+ tableNames = new ArrayList<>(tableNames);
tableNames.add(MetadataTable.NAME);
String tableName = tableNames.get(rand.nextInt(tableNames.size()));
- TreeSet<Text> splits = new TreeSet<Text>();
+ TreeSet<Text> splits = new TreeSet<>();
for (int i = 0; i < rand.nextInt(10) + 1; i++)
splits.add(new Text(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
index 187199f..111e6c7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
@@ -52,7 +52,7 @@ public class BatchScan extends Test {
try {
BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 3);
- List<Range> ranges = new ArrayList<Range>();
+ List<Range> ranges = new ArrayList<>();
for (int i = 0; i < rand.nextInt(2000) + 1; i++)
ranges.add(new Range(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
index ec89a5a..0e5e439 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BulkImport.java
@@ -116,7 +116,7 @@ public class BulkImport extends Test {
try {
BatchWriter bw = new RFileBatchWriter(conf, fs, bulkDir + "/file01.rf");
try {
- TreeSet<Long> rows = new TreeSet<Long>();
+ TreeSet<Long> rows = new TreeSet<>();
int numRows = rand.nextInt(100000);
for (int i = 0; i < numRows; i++) {
rows.add(rand.nextLong() & 0x7fffffffffffffffl);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
index 65502c3..646c415 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangeAuthorizations.java
@@ -43,7 +43,7 @@ public class ChangeAuthorizations extends Test {
String userName = userNames.get(rand.nextInt(userNames.size()));
try {
- List<byte[]> auths = new ArrayList<byte[]>(conn.securityOperations().getUserAuthorizations(userName).getAuthorizations());
+ List<byte[]> auths = new ArrayList<>(conn.securityOperations().getUserAuthorizations(userName).getAuthorizations());
if (rand.nextBoolean()) {
String authorization = String.format("a%d", rand.nextInt(5000));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
index 680750a..7e8f789 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ChangePermissions.java
@@ -88,13 +88,13 @@ public class ChangePermissions extends Test {
more.removeAll(perms);
if (rand.nextBoolean() && more.size() > 0) {
- List<TablePermission> moreList = new ArrayList<TablePermission>(more);
+ List<TablePermission> moreList = new ArrayList<>(more);
TablePermission choice = moreList.get(rand.nextInt(moreList.size()));
log.debug("adding permission " + choice);
conn.securityOperations().grantTablePermission(userName, tableName, choice);
} else {
if (perms.size() > 0) {
- List<TablePermission> permList = new ArrayList<TablePermission>(perms);
+ List<TablePermission> permList = new ArrayList<>(perms);
TablePermission choice = permList.get(rand.nextInt(permList.size()));
log.debug("removing permission " + choice);
conn.securityOperations().revokeTablePermission(userName, tableName, choice);
@@ -114,13 +114,13 @@ public class ChangePermissions extends Test {
more.remove(SystemPermission.GRANT);
if (rand.nextBoolean() && more.size() > 0) {
- List<SystemPermission> moreList = new ArrayList<SystemPermission>(more);
+ List<SystemPermission> moreList = new ArrayList<>(more);
SystemPermission choice = moreList.get(rand.nextInt(moreList.size()));
log.debug("adding permission " + choice);
conn.securityOperations().grantSystemPermission(userName, choice);
} else {
if (perms.size() > 0) {
- List<SystemPermission> permList = new ArrayList<SystemPermission>(perms);
+ List<SystemPermission> permList = new ArrayList<>(perms);
SystemPermission choice = permList.get(rand.nextInt(permList.size()));
log.debug("removing permission " + choice);
conn.securityOperations().revokeSystemPermission(userName, choice);
@@ -140,13 +140,13 @@ public class ChangePermissions extends Test {
more.removeAll(perms);
if (rand.nextBoolean() && more.size() > 0) {
- List<NamespacePermission> moreList = new ArrayList<NamespacePermission>(more);
+ List<NamespacePermission> moreList = new ArrayList<>(more);
NamespacePermission choice = moreList.get(rand.nextInt(moreList.size()));
log.debug("adding permission " + choice);
conn.securityOperations().grantNamespacePermission(userName, namespace, choice);
} else {
if (perms.size() > 0) {
- List<NamespacePermission> permList = new ArrayList<NamespacePermission>(perms);
+ List<NamespacePermission> permList = new ArrayList<>(perms);
NamespacePermission choice = permList.get(rand.nextInt(permList.size()));
log.debug("removing permission " + choice);
conn.securityOperations().revokeNamespacePermission(userName, namespace, choice);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
index b27f34c..403a66a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/ConcurrentFixture.java
@@ -46,7 +46,7 @@ public class ConcurrentFixture extends Fixture {
* @return A two element list with first being smaller than the second, but either value (or both) can be null
*/
public static List<Text> generateRange(Random rand) {
- ArrayList<Text> toRet = new ArrayList<Text>(2);
+ ArrayList<Text> toRet = new ArrayList<>(2);
long firstLong = rand.nextLong();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
index 280f620..c164b6b 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DeleteRange.java
@@ -43,7 +43,7 @@ public class DeleteRange extends Test {
String tableName = tableNames.get(rand.nextInt(tableNames.size()));
- List<Text> range = new ArrayList<Text>();
+ List<Text> range = new ArrayList<>();
do {
range.add(new Text(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
range.add(new Text(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
index 1bb51bb..eac39fa 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/IsolatedScan.java
@@ -52,7 +52,7 @@ public class IsolatedScan extends Test {
RowIterator iter = new RowIterator(new IsolatedScanner(conn.createScanner(tableName, Authorizations.EMPTY)));
while (iter.hasNext()) {
- PeekingIterator<Entry<Key,Value>> row = new PeekingIterator<Entry<Key,Value>>(iter.next());
+ PeekingIterator<Entry<Key,Value>> row = new PeekingIterator<>(iter.next());
Entry<Key,Value> kv = null;
if (row.hasNext())
kv = row.peek();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
index a997c2b..fe84dca 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
@@ -40,7 +40,7 @@ public class Merge extends Test {
@SuppressWarnings("unchecked")
List<String> tableNames = (List<String>) state.get("tables");
- tableNames = new ArrayList<String>(tableNames);
+ tableNames = new ArrayList<>(tableNames);
tableNames.add(MetadataTable.NAME);
String tableName = tableNames.get(rand.nextInt(tableNames.size()));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
index c19fcbd..ee7ae32 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
@@ -36,8 +36,8 @@ public class Setup extends Test {
int numNamespaces = Integer.parseInt(props.getProperty("numNamespaces", "2"));
log.debug("numTables = " + numTables);
log.debug("numNamespaces = " + numNamespaces);
- List<String> tables = new ArrayList<String>();
- List<String> namespaces = new ArrayList<String>();
+ List<String> tables = new ArrayList<>();
+ List<String> namespaces = new ArrayList<>();
for (int i = 0; i < numNamespaces; i++) {
namespaces.add(String.format("nspc_%03d", i));
@@ -62,7 +62,7 @@ public class Setup extends Test {
int numUsers = Integer.parseInt(props.getProperty("numUsers", "5"));
log.debug("numUsers = " + numUsers);
- List<String> users = new ArrayList<String>();
+ List<String> users = new ArrayList<>();
for (int i = 0; i < numUsers; i++)
users.add(String.format("user%03d", i));
state.set("users", users);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
index 995a72e..d819cc0 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/StopTabletServer.java
@@ -40,7 +40,7 @@ import org.apache.zookeeper.data.Stat;
public class StopTabletServer extends Test {
Set<TServerInstance> getTServers(Instance instance) throws KeeperException, InterruptedException {
- Set<TServerInstance> result = new HashSet<TServerInstance>();
+ Set<TServerInstance> result = new HashSet<>();
ZooReader rdr = new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
String base = ZooUtil.getRoot(instance) + Constants.ZTSERVERS;
for (String child : rdr.getChildren(base)) {
@@ -66,7 +66,7 @@ public class StopTabletServer extends Test {
Instance instance = env.getInstance();
- List<TServerInstance> currentServers = new ArrayList<TServerInstance>(getTServers(instance));
+ List<TServerInstance> currentServers = new ArrayList<>(getTServers(instance));
Collections.shuffle(currentServers);
Runtime runtime = Runtime.getRuntime();
if (currentServers.size() > 1) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Init.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Init.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Init.java
index ebe12ef..4668802 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Init.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Init.java
@@ -43,13 +43,13 @@ public class Init extends Test {
int numAccts = (Integer) state.get("numAccts");
// add some splits to spread ingest out a little
- TreeSet<Text> splits = new TreeSet<Text>();
+ TreeSet<Text> splits = new TreeSet<>();
for (int i = 1; i < 10; i++)
splits.add(new Text(Utils.getBank((int) (numBanks * .1 * i))));
env.getConnector().tableOperations().addSplits((String) state.get("tableName"), splits);
log.debug("Added splits " + splits);
- ArrayList<Integer> banks = new ArrayList<Integer>();
+ ArrayList<Integer> banks = new ArrayList<>();
for (int i = 0; i < numBanks; i++)
banks.add(i);
// shuffle for case when multiple threads are adding banks
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Split.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Split.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Split.java
index a1ca830..0d7fee1 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Split.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/conditional/Split.java
@@ -39,7 +39,7 @@ public class Split extends Test {
String row = Utils.getBank(rand.nextInt((Integer) state.get("numBanks")));
log.debug("adding split " + row);
- conn.tableOperations().addSplits(table, new TreeSet<Text>(Arrays.asList(new Text(row))));
+ conn.tableOperations().addSplits(table, new TreeSet<>(Arrays.asList(new Text(row))));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
index 3bcc41c..b37ff90 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
@@ -47,7 +47,7 @@ public class ImageFixture extends Fixture {
Connector conn = env.getConnector();
Instance instance = env.getInstance();
- SortedSet<Text> splits = new TreeSet<Text>();
+ SortedSet<Text> splits = new TreeSet<>();
for (int i = 1; i < 256; i++) {
splits.add(new Text(String.format("%04x", i << 8)));
}
@@ -94,13 +94,13 @@ public class ImageFixture extends Fixture {
}
static Map<String,Set<Text>> getLocalityGroups() {
- Map<String,Set<Text>> groups = new HashMap<String,Set<Text>>();
+ Map<String,Set<Text>> groups = new HashMap<>();
- HashSet<Text> lg1 = new HashSet<Text>();
+ HashSet<Text> lg1 = new HashSet<>();
lg1.add(Write.CONTENT_COLUMN_FAMILY);
groups.put("lg1", lg1);
- HashSet<Text> lg2 = new HashSet<Text>();
+ HashSet<Text> lg2 = new HashSet<>();
lg2.add(Write.META_COLUMN_FAMILY);
groups.put("lg2", lg2);
return groups;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
index 4b801c2..49d33d0 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
@@ -63,7 +63,7 @@ public class ScanMeta extends Test {
Random rand = new Random();
int numToScan = rand.nextInt(maxScan - minScan) + minScan;
- Map<Text,Text> hashes = new HashMap<Text,Text>();
+ Map<Text,Text> hashes = new HashMap<>();
Iterator<Entry<Key,Value>> iter = imageScanner.iterator();
@@ -84,14 +84,14 @@ public class ScanMeta extends Test {
// use batch scanner to verify all of these exist in index
BatchScanner indexScanner = conn.createBatchScanner(indexTableName, Authorizations.EMPTY, 3);
- ArrayList<Range> ranges = new ArrayList<Range>();
+ ArrayList<Range> ranges = new ArrayList<>();
for (Text row : hashes.keySet()) {
ranges.add(new Range(row));
}
indexScanner.setRanges(ranges);
- Map<Text,Text> hashes2 = new HashMap<Text,Text>();
+ Map<Text,Text> hashes2 = new HashMap<>();
for (Entry<Key,Value> entry : indexScanner)
hashes2.put(entry.getKey().getRow(), new Text(entry.getValue().get()));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/image/TableOp.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/TableOp.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/TableOp.java
index b62ec34..d2b5e2f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/TableOp.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/TableOp.java
@@ -72,7 +72,7 @@ public class TableOp extends Test {
groups = ImageFixture.getLocalityGroups();
} else {
log.debug("Removing locality groups from " + state.getString("imageTableName"));
- groups = new HashMap<String,Set<Text>>();
+ groups = new HashMap<>();
}
tableOps.setLocalityGroups(state.getString("imageTableName"), groups);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
index d02cb42..46ae035 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CopyTable.java
@@ -34,7 +34,7 @@ public class CopyTable extends Test {
private final TreeSet<Text> splits;
public CopyTable() {
- splits = new TreeSet<Text>();
+ splits = new TreeSet<>();
for (int i = 1; i < 10; i++) {
splits.add(new Text(Integer.toString(i)));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
index 27ab09c..2669d9d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/CreateTable.java
@@ -33,7 +33,7 @@ public class CreateTable extends Test {
private final TreeSet<Text> splits;
public CreateTable() {
- splits = new TreeSet<Text>();
+ splits = new TreeSet<>();
for (int i = 1; i < 10; i++) {
splits.add(new Text(Integer.toString(i)));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
index d895c55..477d95f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/TableOp.java
@@ -195,7 +195,7 @@ public class TableOp extends Test {
break;
case BULK_IMPORT:
key = WalkingSecurity.get(state, env).getLastKey() + "1";
- SortedSet<Key> keys = new TreeSet<Key>();
+ SortedSet<Key> keys = new TreeSet<>();
for (String s : WalkingSecurity.get(state, env).getAuthsArray()) {
Key k = new Key(key, "", "", s);
keys.add(k);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 457b478..0c440af 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -154,7 +154,7 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
@Override
public Set<String> listUsers() throws AccumuloSecurityException {
- Set<String> userList = new TreeSet<String>();
+ Set<String> userList = new TreeSet<>();
for (String user : new String[] {getSysUserName(), getTabUserName()}) {
if (userExists(user))
userList.add(user);
@@ -488,7 +488,7 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
@Override
public Set<Class<? extends AuthenticationToken>> getSupportedTokenTypes() {
- Set<Class<? extends AuthenticationToken>> cs = new HashSet<Class<? extends AuthenticationToken>>();
+ Set<Class<? extends AuthenticationToken>> cs = new HashSet<>();
cs.add(PasswordToken.class);
return cs;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
index 9ae1bf7..074cbcf 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
@@ -55,7 +55,7 @@ public class BatchVerify extends Test {
try {
int count = 0;
- List<Range> ranges = new ArrayList<Range>();
+ List<Range> ranges = new ArrayList<>();
while (count < numVerify) {
long rangeStart = rand.nextInt((int) numWrites);
long rangeEnd = rangeStart + 99;
@@ -81,7 +81,7 @@ public class BatchVerify extends Test {
scanner.setRanges(ranges);
- List<Key> keys = new ArrayList<Key>();
+ List<Key> keys = new ArrayList<>();
for (Entry<Key,Value> entry : scanner) {
keys.add(entry.getKey());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
index a73b311..42dc9dc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/CompactFilter.java
@@ -49,7 +49,7 @@ public class CompactFilter extends Test {
String deleteChar = Integer.toHexString(rand.nextInt(16)) + "";
String regex = "^[0-9a-f][" + deleteChar + "].*";
- ArrayList<IteratorSetting> documentFilters = new ArrayList<IteratorSetting>();
+ ArrayList<IteratorSetting> documentFilters = new ArrayList<>();
IteratorSetting is = new IteratorSetting(21, "ii", RegExFilter.class);
RegExFilter.setRegexs(is, regex, null, null, null, false);
@@ -61,7 +61,7 @@ public class CompactFilter extends Test {
long t2 = System.currentTimeMillis();
long t3 = t2 - t1;
- ArrayList<IteratorSetting> indexFilters = new ArrayList<IteratorSetting>();
+ ArrayList<IteratorSetting> indexFilters = new ArrayList<>();
is = new IteratorSetting(21, RegExFilter.class);
RegExFilter.setRegexs(is, null, null, regex, null, false);
@@ -76,7 +76,7 @@ public class CompactFilter extends Test {
BatchScanner bscanner = env.getConnector().createBatchScanner(docTableName, new Authorizations(), 10);
- List<Range> ranges = new ArrayList<Range>();
+ List<Range> ranges = new ArrayList<>();
for (int i = 0; i < 16; i++) {
ranges.add(Range.prefix(new Text(Integer.toHexString(i) + "" + deleteChar)));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
index f7fb1df..08fcb4f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteSomeDocs.java
@@ -43,7 +43,7 @@ public class DeleteSomeDocs extends Test {
String indexTableName = (String) state.get("indexTableName");
String dataTableName = (String) state.get("docTableName");
- ArrayList<String> patterns = new ArrayList<String>();
+ ArrayList<String> patterns = new ArrayList<>();
for (Object key : props.keySet())
if (key instanceof String && ((String) key).startsWith("pattern"))
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
index 28b1899..9de0240 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/DeleteWord.java
@@ -54,7 +54,7 @@ public class DeleteWord extends Test {
Scanner scanner = env.getConnector().createScanner(indexTableName, Authorizations.EMPTY);
scanner.fetchColumnFamily(new Text(wordToDelete));
- ArrayList<Range> documentsToDelete = new ArrayList<Range>();
+ ArrayList<Range> documentsToDelete = new ArrayList<>();
for (Entry<Key,Value> entry : scanner)
documentsToDelete.add(new Range(entry.getKey().getColumnQualifier()));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
index ca273ac..5b57ace 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ExportIndex.java
@@ -89,17 +89,17 @@ public class ExportIndex extends Test {
fs.delete(new Path(exportDir), true);
fs.delete(new Path(copyDir), true);
- HashSet<Text> splits1 = new HashSet<Text>(env.getConnector().tableOperations().listSplits(indexTableName));
- HashSet<Text> splits2 = new HashSet<Text>(env.getConnector().tableOperations().listSplits(tmpIndexTableName));
+ HashSet<Text> splits1 = new HashSet<>(env.getConnector().tableOperations().listSplits(indexTableName));
+ HashSet<Text> splits2 = new HashSet<>(env.getConnector().tableOperations().listSplits(tmpIndexTableName));
if (!splits1.equals(splits2))
throw new Exception("Splits not equals " + indexTableName + " " + tmpIndexTableName);
- HashMap<String,String> props1 = new HashMap<String,String>();
+ HashMap<String,String> props1 = new HashMap<>();
for (Entry<String,String> entry : env.getConnector().tableOperations().getProperties(indexTableName))
props1.put(entry.getKey(), entry.getValue());
- HashMap<String,String> props2 = new HashMap<String,String>();
+ HashMap<String,String> props2 = new HashMap<>();
for (Entry<String,String> entry : env.getConnector().tableOperations().getProperties(tmpIndexTableName))
props2.put(entry.getKey(), entry.getValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
index d5c5e5d..7409ea7 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Grep.java
@@ -59,7 +59,7 @@ public class Grep extends Test {
bs.addScanIterator(ii);
bs.setRanges(Collections.singleton(new Range()));
- HashSet<Text> documentsFoundInIndex = new HashSet<Text>();
+ HashSet<Text> documentsFoundInIndex = new HashSet<>();
for (Entry<Key,Value> entry2 : bs) {
documentsFoundInIndex.add(entry2.getKey().getColumnQualifier());
@@ -77,7 +77,7 @@ public class Grep extends Test {
bs.setRanges(Collections.singleton(new Range()));
- HashSet<Text> documentsFoundByGrep = new HashSet<Text>();
+ HashSet<Text> documentsFoundByGrep = new HashSet<>();
for (Entry<Key,Value> entry2 : bs) {
documentsFoundByGrep.add(entry2.getKey().getRow());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
index 4fdbbb9..8482a59 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
@@ -115,7 +115,7 @@ public class Insert extends Test {
Mutation m = new Mutation(partition);
- HashSet<String> tokensSeen = new HashSet<String>();
+ HashSet<String> tokensSeen = new HashSet<>();
for (String token : tokens) {
token = token.toLowerCase();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
index 36a70f6..910e64c 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Merge.java
@@ -33,7 +33,7 @@ public class Merge extends Test {
String indexTableName = (String) state.get("indexTableName");
Collection<Text> splits = env.getConnector().tableOperations().listSplits(indexTableName);
- SortedSet<Text> splitSet = new TreeSet<Text>(splits);
+ SortedSet<Text> splitSet = new TreeSet<>(splits);
log.debug("merging " + indexTableName);
env.getConnector().tableOperations().merge(indexTableName, null, null);
org.apache.accumulo.core.util.Merge merge = new org.apache.accumulo.core.util.Merge();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
index 899ec42..bccb280 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Search.java
@@ -57,7 +57,7 @@ public class Search extends Test {
if (numSearchTerms < 2)
numSearchTerms = 2;
- HashSet<String> searchTerms = new HashSet<String>();
+ HashSet<String> searchTerms = new HashSet<>();
while (searchTerms.size() < numSearchTerms)
searchTerms.add(tokens[rand.nextInt(tokens.length)]);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index 63500a0..99e3a61 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@ -39,7 +39,7 @@ public class ShardFixture extends Fixture {
long distance = max / numTablets;
long split = distance;
- TreeSet<Text> splits = new TreeSet<Text>();
+ TreeSet<Text> splits = new TreeSet<>();
for (int i = 0; i < numSplits; i++) {
splits.add(new Text(String.format(format, split)));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
index 16c317f..8603cd6 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/CyclicReplicationIT.java
@@ -113,7 +113,7 @@ public class CyclicReplicationIT {
// Set the same SSL information from the primary when present
Map<String,String> primarySiteConfig = primaryCfg.getSiteConfig();
if ("true".equals(primarySiteConfig.get(Property.INSTANCE_RPC_SSL_ENABLED.getKey()))) {
- Map<String,String> peerSiteConfig = new HashMap<String,String>();
+ Map<String,String> peerSiteConfig = new HashMap<>();
peerSiteConfig.put(Property.INSTANCE_RPC_SSL_ENABLED.getKey(), "true");
String keystorePath = primarySiteConfig.get(Property.RPC_SSL_KEYSTORE_PATH.getKey());
Assert.assertNotNull("Keystore Path was null", keystorePath);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java b/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
index 2852387..fccb238 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/GarbageCollectorCommunicatesWithTServersIT.java
@@ -110,7 +110,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
ZooReaderWriter zk = new ZooReaderWriter(i.getZooKeepers(), i.getZooKeepersSessionTimeOut(), "");
WalStateManager wals = new WalStateManager(conn.getInstance(), zk);
- Set<String> result = new HashSet<String>();
+ Set<String> result = new HashSet<>();
for (Entry<Path,WalState> entry : wals.getAllState().entrySet()) {
log.debug("Reading WALs: {}={}", entry.getKey(), entry.getValue());
result.add(entry.getKey().toString());
@@ -132,7 +132,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
s.setRange(r);
s.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME);
- Set<String> rfiles = new HashSet<String>();
+ Set<String> rfiles = new HashSet<>();
for (Entry<Key,Value> entry : s) {
log.debug("Reading RFiles: {}={}", entry.getKey().toStringNoTruncate(), entry.getValue());
// uri://path/to/wal
@@ -159,7 +159,7 @@ public class GarbageCollectorCommunicatesWithTServersIT extends ConfigurableMacB
s.setRange(r);
s.fetchColumn(MetadataSchema.ReplicationSection.COLF, new Text(tableId));
- Map<String,Status> fileToStatus = new HashMap<String,Status>();
+ Map<String,Status> fileToStatus = new HashMap<>();
for (Entry<Key,Value> entry : s) {
Text file = new Text();
MetadataSchema.ReplicationSection.getFile(entry.getKey(), file);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
index 0c68af6..33e0a55 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/MultiInstanceReplicationIT.java
@@ -116,7 +116,7 @@ public class MultiInstanceReplicationIT extends ConfigurableMacBase {
// Set the same SSL information from the primary when present
Map<String,String> primarySiteConfig = primaryCfg.getSiteConfig();
if ("true".equals(primarySiteConfig.get(Property.INSTANCE_RPC_SSL_ENABLED.getKey()))) {
- Map<String,String> peerSiteConfig = new HashMap<String,String>();
+ Map<String,String> peerSiteConfig = new HashMap<>();
peerSiteConfig.put(Property.INSTANCE_RPC_SSL_ENABLED.getKey(), "true");
String keystorePath = primarySiteConfig.get(Property.RPC_SSL_KEYSTORE_PATH.getKey());
Assert.assertNotNull("Keystore Path was null", keystorePath);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/StatusCombinerMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/StatusCombinerMacIT.java b/test/src/main/java/org/apache/accumulo/test/replication/StatusCombinerMacIT.java
index b0a787b..59bfab0 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/StatusCombinerMacIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/StatusCombinerMacIT.java
@@ -66,7 +66,7 @@ public class StatusCombinerMacIT extends SharedMiniClusterBase {
Assert.assertTrue(scopes.contains(IteratorScope.majc));
Iterable<Entry<String,String>> propIter = tops.getProperties(MetadataTable.NAME);
- HashMap<String,String> properties = new HashMap<String,String>();
+ HashMap<String,String> properties = new HashMap<>();
for (Entry<String,String> entry : propIter) {
properties.put(entry.getKey(), entry.getValue());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
index 5d4e637..ec0361b 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
@@ -122,7 +122,7 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacBase {
// Set the same SSL information from the primary when present
Map<String,String> primarySiteConfig = primaryCfg.getSiteConfig();
if ("true".equals(primarySiteConfig.get(Property.INSTANCE_RPC_SSL_ENABLED.getKey()))) {
- Map<String,String> peerSiteConfig = new HashMap<String,String>();
+ Map<String,String> peerSiteConfig = new HashMap<>();
peerSiteConfig.put(Property.INSTANCE_RPC_SSL_ENABLED.getKey(), "true");
String keystorePath = primarySiteConfig.get(Property.RPC_SSL_KEYSTORE_PATH.getKey());
Assert.assertNotNull("Keystore Path was null", keystorePath);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTree.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTree.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTree.java
index 03eb466..9a4b127 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTree.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTree.java
@@ -67,7 +67,7 @@ public class MerkleTree {
// At the same level
if (left.getLevel() == right.getLevel()) {
- return new Pair<Integer,Integer>(i, j);
+ return new Pair<>(i, j);
}
// Peek to see if we have another element
@@ -77,14 +77,14 @@ public class MerkleTree {
j++;
} else {
// Otherwise, the last two elements must be paired
- return new Pair<Integer,Integer>(i, j);
+ return new Pair<>(i, j);
}
}
if (2 < nodes.size()) {
throw new IllegalStateException("Should not have exited loop without pairing two elements when we have at least 3 nodes");
} else if (2 == nodes.size()) {
- return new Pair<Integer,Integer>(0, 1);
+ return new Pair<>(0, 1);
} else {
throw new IllegalStateException("Must have at least two nodes to pair");
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTreeNode.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTreeNode.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTreeNode.java
index 33ec056..f392f12 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTreeNode.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/MerkleTreeNode.java
@@ -58,7 +58,7 @@ public class MerkleTreeNode {
public MerkleTreeNode(List<MerkleTreeNode> children, String digestAlgorithm) throws NoSuchAlgorithmException {
level = 0;
- this.children = new ArrayList<Range>(children.size());
+ this.children = new ArrayList<>(children.size());
MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
Range childrenRange = null;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/ComputeRootHash.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/ComputeRootHash.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/ComputeRootHash.java
index cb2761b..56a5931 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/ComputeRootHash.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/ComputeRootHash.java
@@ -76,7 +76,7 @@ public class ComputeRootHash {
protected ArrayList<MerkleTreeNode> getLeaves(Connector conn, String tableName) throws TableNotFoundException {
// TODO make this a bit more resilient to very large merkle trees by lazily reading more data from the table when necessary
final Scanner s = conn.createScanner(tableName, Authorizations.EMPTY);
- final ArrayList<MerkleTreeNode> leaves = new ArrayList<MerkleTreeNode>();
+ final ArrayList<MerkleTreeNode> leaves = new ArrayList<>();
for (Entry<Key,Value> entry : s) {
Range range = RangeSerialization.toRange(entry.getKey());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/GenerateHashes.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/GenerateHashes.java b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/GenerateHashes.java
index b1ef6c3..72da0ae 100644
--- a/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/GenerateHashes.java
+++ b/test/src/main/java/org/apache/accumulo/test/replication/merkle/cli/GenerateHashes.java
@@ -129,7 +129,7 @@ public class GenerateHashes {
return endRowsToRanges(endRows);
} else {
log.info("Using provided split points");
- ArrayList<Text> splits = new ArrayList<Text>();
+ ArrayList<Text> splits = new ArrayList<>();
String line;
java.util.Scanner file = new java.util.Scanner(new File(splitsFile), UTF_8.name());
@@ -249,7 +249,7 @@ public class GenerateHashes {
}
public TreeSet<Range> endRowsToRanges(Collection<Text> endRows) {
- ArrayList<Text> sortedEndRows = new ArrayList<Text>(endRows);
+ ArrayList<Text> sortedEndRows = new ArrayList<>(endRows);
Collections.sort(sortedEndRows);
Text prevEndRow = null;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
index f908296..2f82bfa 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
@@ -70,7 +70,7 @@ public abstract class ScaleTest {
int numSplits = numTabletServers - 1;
long distance = (Long.MAX_VALUE / numTabletServers) + 1;
long split = distance;
- TreeSet<Text> keys = new TreeSet<Text>();
+ TreeSet<Text> keys = new TreeSet<>();
for (int i = 0; i < numSplits; i++) {
keys.add(new Text(String.format("%016x", split)));
split += distance;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java b/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
index 2345ea7..95042d2 100644
--- a/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
+++ b/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
@@ -135,7 +135,7 @@ public class CertUtils {
@Override
public Iterator<Entry<String,String>> iterator() {
- TreeMap<String,String> map = new TreeMap<String,String>();
+ TreeMap<String,String> map = new TreeMap<>();
for (Entry<String,String> props : DefaultConfiguration.getInstance())
map.put(props.getKey(), props.getValue());
for (Entry<String,String> props : xml)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java b/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
index 6189ee3..4b2de22 100644
--- a/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
+++ b/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java
@@ -41,7 +41,7 @@ public class RegExTest {
@BeforeClass
public static void setupTests() throws Exception {
- ArrayList<Character> chars = new ArrayList<Character>();
+ ArrayList<Character> chars = new ArrayList<>();
for (char c = 'a'; c <= 'z'; c++)
chars.add(c);