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:17 UTC
[20/32] accumulo git commit: ACCUMULO-4357 Remove unneeded code for
readability
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index f87131e..3d820dd 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -33,7 +33,7 @@ import org.apache.htrace.wrappers.TraceRunnable;
*/
class CompactionQueue extends AbstractQueue<TraceRunnable> implements BlockingQueue<TraceRunnable> {
- private List<TraceRunnable> task = new LinkedList<TraceRunnable>();
+ private List<TraceRunnable> task = new LinkedList<>();
private static final Comparator<TraceRunnable> comparator = new Comparator<TraceRunnable>() {
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
index 82e5057..e1a8de8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
@@ -54,8 +54,8 @@ public class ConditionalMutationSet {
static void defer(Map<KeyExtent,List<ServerConditionalMutation>> updates, Map<KeyExtent,List<ServerConditionalMutation>> deferredMutations, DeferFilter filter) {
for (Entry<KeyExtent,List<ServerConditionalMutation>> entry : updates.entrySet()) {
List<ServerConditionalMutation> scml = entry.getValue();
- List<ServerConditionalMutation> okMutations = new ArrayList<ServerConditionalMutation>(scml.size());
- List<ServerConditionalMutation> deferred = new ArrayList<ServerConditionalMutation>();
+ List<ServerConditionalMutation> okMutations = new ArrayList<>(scml.size());
+ List<ServerConditionalMutation> deferred = new ArrayList<>();
filter.defer(scml, okMutations, deferred);
if (deferred.size() > 0) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
index 699b5a7..8bc0fed 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
@@ -125,7 +125,7 @@ public class FileManager {
long curTime = System.currentTimeMillis();
- ArrayList<FileSKVIterator> filesToClose = new ArrayList<FileSKVIterator>();
+ ArrayList<FileSKVIterator> filesToClose = new ArrayList<>();
// determine which files to close in a sync block, and then close the
// files outside of the sync block
@@ -176,8 +176,8 @@ public class FileManager {
this.maxOpen = maxOpen;
this.fs = fs;
- this.openFiles = new HashMap<String,List<OpenReader>>();
- this.reservedReaders = new HashMap<FileSKVIterator,String>();
+ this.openFiles = new HashMap<>();
+ this.reservedReaders = new HashMap<>();
this.maxIdleTime = context.getConfiguration().getTimeInMillis(Property.TSERV_MAX_IDLE);
SimpleTimer.getInstance(context.getConfiguration()).schedule(new IdleFileCloser(), maxIdleTime, maxIdleTime / 2);
@@ -196,7 +196,7 @@ public class FileManager {
private List<FileSKVIterator> takeLRUOpenFiles(int numToTake) {
- ArrayList<OpenReader> openReaders = new ArrayList<OpenReader>();
+ ArrayList<OpenReader> openReaders = new ArrayList<>();
for (Entry<String,List<OpenReader>> entry : openFiles.entrySet()) {
openReaders.addAll(entry.getValue());
@@ -204,7 +204,7 @@ public class FileManager {
Collections.sort(openReaders);
- ArrayList<FileSKVIterator> ret = new ArrayList<FileSKVIterator>();
+ ArrayList<FileSKVIterator> ret = new ArrayList<>();
for (int i = 0; i < numToTake && i < openReaders.size(); i++) {
OpenReader or = openReaders.get(i);
@@ -227,7 +227,7 @@ public class FileManager {
private static <T> List<T> getFileList(String file, Map<String,List<T>> files) {
List<T> ofl = files.get(file);
if (ofl == null) {
- ofl = new ArrayList<T>();
+ ofl = new ArrayList<>();
files.put(file, ofl);
}
@@ -245,7 +245,7 @@ public class FileManager {
}
private List<String> takeOpenFiles(Collection<String> files, List<FileSKVIterator> reservedFiles, Map<FileSKVIterator,String> readersReserved) {
- List<String> filesToOpen = new LinkedList<String>(files);
+ List<String> filesToOpen = new LinkedList<>(files);
for (Iterator<String> iterator = filesToOpen.iterator(); iterator.hasNext();) {
String file = iterator.next();
@@ -280,8 +280,8 @@ public class FileManager {
List<String> filesToOpen = null;
List<FileSKVIterator> filesToClose = Collections.emptyList();
- List<FileSKVIterator> reservedFiles = new ArrayList<FileSKVIterator>();
- Map<FileSKVIterator,String> readersReserved = new HashMap<FileSKVIterator,String>();
+ List<FileSKVIterator> reservedFiles = new ArrayList<>();
+ Map<FileSKVIterator,String> readersReserved = new HashMap<>();
if (!tablet.isMeta()) {
filePermits.acquireUninterruptibly(files.size());
@@ -401,7 +401,7 @@ public class FileManager {
FileDataSource(String file, SortedKeyValueIterator<Key,Value> iter) {
this.file = file;
this.iter = iter;
- this.deepCopies = new ArrayList<FileManager.FileDataSource>();
+ this.deepCopies = new ArrayList<>();
}
public FileDataSource(IteratorEnvironment env, SortedKeyValueIterator<Key,Value> deepCopy, ArrayList<FileDataSource> deepCopies) {
@@ -470,8 +470,8 @@ public class FileManager {
private boolean continueOnFailure;
ScanFileManager(KeyExtent tablet) {
- tabletReservedReaders = new ArrayList<FileSKVIterator>();
- dataSources = new ArrayList<FileDataSource>();
+ tabletReservedReaders = new ArrayList<>();
+ dataSources = new ArrayList<>();
this.tablet = tablet;
continueOnFailure = context.getServerConfigurationFactory().getTableConfiguration(tablet).getBoolean(Property.TABLE_FAILURES_IGNORE);
@@ -482,7 +482,7 @@ public class FileManager {
}
private List<FileSKVIterator> openFileRefs(Collection<FileRef> files) throws TooManyFilesException, IOException {
- List<String> strings = new ArrayList<String>(files.size());
+ List<String> strings = new ArrayList<>(files.size());
for (FileRef ref : files)
strings.add(ref.path().toString());
return openFiles(strings);
@@ -508,7 +508,7 @@ public class FileManager {
List<FileSKVIterator> newlyReservedReaders = openFileRefs(files.keySet());
- ArrayList<InterruptibleIterator> iters = new ArrayList<InterruptibleIterator>();
+ ArrayList<InterruptibleIterator> iters = new ArrayList<>();
for (FileSKVIterator reader : newlyReservedReaders) {
String filename = getReservedReadeFilename(reader);
@@ -554,17 +554,17 @@ public class FileManager {
if (tabletReservedReaders.size() != 0)
throw new IllegalStateException();
- Collection<String> files = new ArrayList<String>();
+ Collection<String> files = new ArrayList<>();
for (FileDataSource fds : dataSources)
files.add(fds.file);
List<FileSKVIterator> newlyReservedReaders = openFiles(files);
- Map<String,List<FileSKVIterator>> map = new HashMap<String,List<FileSKVIterator>>();
+ Map<String,List<FileSKVIterator>> map = new HashMap<>();
for (FileSKVIterator reader : newlyReservedReaders) {
String fileName = getReservedReadeFilename(reader);
List<FileSKVIterator> list = map.get(fileName);
if (list == null) {
- list = new LinkedList<FileSKVIterator>();
+ list = new LinkedList<>();
map.put(fileName, list);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
index a87586b..c1ae9e6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
@@ -297,7 +297,7 @@ public class InMemoryMap {
this.groupFams = new PreAllocatedArray<>(groups.size());
this.maps = new SimpleMap[groups.size() + 1];
this.partitioned = new PreAllocatedArray<>(groups.size() + 1);
- this.nonDefaultColumnFamilies = new HashSet<ByteSequence>();
+ this.nonDefaultColumnFamilies = new HashSet<>();
for (int i = 0; i < maps.length; i++) {
maps[i] = newMap(useNativeMap);
@@ -305,7 +305,7 @@ public class InMemoryMap {
int count = 0;
for (Set<ByteSequence> cfset : groups.values()) {
- HashMap<ByteSequence,MutableLong> map = new HashMap<ByteSequence,MutableLong>();
+ HashMap<ByteSequence,MutableLong> map = new HashMap<>();
for (ByteSequence bs : cfset)
map.put(bs, new MutableLong(1));
this.groupFams.set(count++, map);
@@ -394,7 +394,7 @@ public class InMemoryMap {
}
private static class DefaultMap implements SimpleMap {
- private ConcurrentSkipListMap<Key,Value> map = new ConcurrentSkipListMap<Key,Value>(new MemKeyComparator());
+ private ConcurrentSkipListMap<Key,Value> map = new ConcurrentSkipListMap<>(new MemKeyComparator());
private AtomicLong bytesInMemory = new AtomicLong();
private AtomicInteger size = new AtomicInteger();
@@ -809,7 +809,7 @@ public class InMemoryMap {
InterruptibleIterator iter = map.skvIterator(null);
- HashSet<ByteSequence> allfams = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> allfams = new HashSet<>();
for (Entry<String,Set<ByteSequence>> entry : lggroups.entrySet()) {
allfams.addAll(entry.getValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java
index 3c00b67..00f6ba8 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java
@@ -69,7 +69,7 @@ public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
// Load native library
static {
// Check standard directories
- List<File> directories = new ArrayList<File>(Arrays.asList(new File[] {new File("/usr/lib64"), new File("/usr/lib")}));
+ List<File> directories = new ArrayList<>(Arrays.asList(new File[] {new File("/usr/lib64"), new File("/usr/lib")}));
// Check in ACCUMULO_HOME location, too
String envAccumuloHome = System.getenv("ACCUMULO_HOME");
if (envAccumuloHome != null) {
@@ -106,7 +106,7 @@ public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
public static void loadNativeLib(List<File> searchPath) {
if (!isLoaded()) {
List<String> names = getValidLibraryNames();
- List<File> tryList = new ArrayList<File>(searchPath.size() * names.size());
+ List<File> tryList = new ArrayList<>(searchPath.size() * names.size());
for (File p : searchPath)
if (p.exists() && p.isDirectory())
@@ -131,7 +131,7 @@ public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
}
private static List<String> getValidLibraryNames() {
- ArrayList<String> names = new ArrayList<String>(3);
+ ArrayList<String> names = new ArrayList<>(3);
String libname = System.mapLibraryName("accumulo");
names.add(libname);
@@ -199,7 +199,7 @@ public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
private static synchronized long createNativeMap() {
if (!init) {
- allocatedNativeMaps = new HashSet<Long>();
+ allocatedNativeMaps = new HashSet<>();
Runnable r = new Runnable() {
@Override
@@ -452,7 +452,7 @@ public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
hasNext = nmiNext(nmiPointer, fieldsLens);
- return new SimpleImmutableEntry<Key,Value>(k, v);
+ return new SimpleImmutableEntry<>(k, v);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
index 03707d1..62f321e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
@@ -34,7 +34,7 @@ import org.apache.accumulo.tserver.data.ServerConditionalMutation;
*/
class RowLocks {
- private Map<ByteSequence,RowLock> rowLocks = new HashMap<ByteSequence,RowLock>();
+ private Map<ByteSequence,RowLock> rowLocks = new HashMap<>();
static class RowLock {
ReentrantLock rlock;
@@ -82,7 +82,7 @@ class RowLocks {
}
List<RowLock> acquireRowlocks(Map<KeyExtent,List<ServerConditionalMutation>> updates, Map<KeyExtent,List<ServerConditionalMutation>> deferred) {
- ArrayList<RowLock> locks = new ArrayList<RowLock>();
+ ArrayList<RowLock> locks = new ArrayList<>();
// assume that mutations are in sorted order to avoid deadlock
synchronized (rowLocks) {
@@ -100,7 +100,7 @@ class RowLocks {
for (RowLock rowLock : locks) {
if (!rowLock.tryLock()) {
if (rowsNotLocked == null)
- rowsNotLocked = new HashSet<ByteSequence>();
+ rowsNotLocked = new HashSet<>();
rowsNotLocked.add(rowLock.rowSeq);
}
}
@@ -126,8 +126,8 @@ class RowLocks {
}
});
- ArrayList<RowLock> filteredLocks = new ArrayList<RowLock>();
- ArrayList<RowLock> locksToReturn = new ArrayList<RowLock>();
+ ArrayList<RowLock> filteredLocks = new ArrayList<>();
+ ArrayList<RowLock> locksToReturn = new ArrayList<>();
for (RowLock rowLock : locks) {
if (rowsNotLocked.contains(rowLock.rowSeq)) {
locksToReturn.add(rowLock);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
index f9081b4..445391e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
@@ -97,7 +97,7 @@ public class TabletIteratorEnvironment implements IteratorEnvironment {
this.config = config;
this.fullMajorCompaction = fullMajC;
this.authorizations = Authorizations.EMPTY;
- this.topLevelIterators = new ArrayList<SortedKeyValueIterator<Key,Value>>();
+ this.topLevelIterators = new ArrayList<>();
}
@Override
@@ -138,7 +138,7 @@ public class TabletIteratorEnvironment implements IteratorEnvironment {
public SortedKeyValueIterator<Key,Value> getTopLevelIterator(SortedKeyValueIterator<Key,Value> iter) {
if (topLevelIterators.isEmpty())
return iter;
- ArrayList<SortedKeyValueIterator<Key,Value>> allIters = new ArrayList<SortedKeyValueIterator<Key,Value>>(topLevelIterators);
+ ArrayList<SortedKeyValueIterator<Key,Value>> allIters = new ArrayList<>(topLevelIterators);
allIters.add(iter);
return new MultiIterator(allIters, false);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 5626f12..94e2ed9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -301,7 +301,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
private final TabletServerResourceManager resourceManager;
private final SecurityOperation security;
- private final BlockingDeque<MasterMessage> masterMessages = new LinkedBlockingDeque<MasterMessage>();
+ private final BlockingDeque<MasterMessage> masterMessages = new LinkedBlockingDeque<>();
private Thread majorCompactorThread;
@@ -430,12 +430,12 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
if (!security.canPerformSystemActions(credentials))
throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
- List<TKeyExtent> failures = new ArrayList<TKeyExtent>();
+ List<TKeyExtent> failures = new ArrayList<>();
for (Entry<TKeyExtent,Map<String,MapFileInfo>> entry : files.entrySet()) {
TKeyExtent tke = entry.getKey();
Map<String,MapFileInfo> fileMap = entry.getValue();
- Map<FileRef,MapFileInfo> fileRefMap = new HashMap<FileRef,MapFileInfo>();
+ Map<FileRef,MapFileInfo> fileRefMap = new HashMap<>();
for (Entry<String,MapFileInfo> mapping : fileMap.entrySet()) {
Path path = new Path(mapping.getKey());
FileSystem ns = fs.getVolumeByPath(path).getFileSystem();
@@ -491,7 +491,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
if (tablet == null)
throw new NotServingTabletException(textent);
- Set<Column> columnSet = new HashSet<Column>();
+ Set<Column> columnSet = new HashSet<>();
for (TColumn tcolumn : columns) {
columnSet.add(new Column(tcolumn));
}
@@ -616,7 +616,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites,
TSamplerConfiguration tSamplerConfig, long batchTimeOut, String context) throws ThriftSecurityException, TSampleNotPresentException {
// find all of the tables that need to be scanned
- final HashSet<String> tables = new HashSet<String>();
+ final HashSet<String> tables = new HashSet<>();
for (TKeyExtent keyExtent : tbatch.keySet()) {
tables.add(new String(keyExtent.getTable(), UTF_8));
}
@@ -636,8 +636,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
log.error("{} is not authorized", credentials.getPrincipal(), tse);
throw tse;
}
- Map<KeyExtent,List<Range>> batch = Translator.translate(tbatch, new TKeyExtentTranslator(), new Translator.ListTranslator<TRange,Range>(
- new TRangeTranslator()));
+ Map<KeyExtent,List<Range>> batch = Translator.translate(tbatch, new TKeyExtentTranslator(), new Translator.ListTranslator<>(new TRangeTranslator()));
// This is used to determine which thread pool to use
KeyExtent threadPoolExtent = batch.keySet().iterator().next();
@@ -839,7 +838,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
private void flush(UpdateSession us) {
int mutationCount = 0;
- Map<CommitSession,Mutations> sendables = new HashMap<CommitSession,Mutations>();
+ Map<CommitSession,Mutations> sendables = new HashMap<>();
Throwable error = null;
long pt1 = System.currentTimeMillis();
@@ -1117,7 +1116,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
results.add(new TCMResult(scm.getID(), TCMStatus.IGNORED));
iter.remove();
} else {
- final List<ServerConditionalMutation> okMutations = new ArrayList<ServerConditionalMutation>(entry.getValue().size());
+ final List<ServerConditionalMutation> okMutations = new ArrayList<>(entry.getValue().size());
final List<TCMResult> resultsSubList = results.subList(results.size(), results.size());
ConditionChecker checker = checkerContext.newChecker(entry.getValue(), okMutations, resultsSubList);
@@ -1145,7 +1144,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
private void writeConditionalMutations(Map<KeyExtent,List<ServerConditionalMutation>> updates, ArrayList<TCMResult> results, ConditionalSession sess) {
Set<Entry<KeyExtent,List<ServerConditionalMutation>>> es = updates.entrySet();
- Map<CommitSession,Mutations> sendables = new HashMap<CommitSession,Mutations>();
+ Map<CommitSession,Mutations> sendables = new HashMap<>();
boolean sessionCanceled = sess.interruptFlag.get();
@@ -1239,7 +1238,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
// sort each list of mutations, this is done to avoid deadlock and doing seeks in order is more efficient and detect duplicate rows.
ConditionalMutationSet.sortConditionalMutations(updates);
- Map<KeyExtent,List<ServerConditionalMutation>> deferred = new HashMap<KeyExtent,List<ServerConditionalMutation>>();
+ Map<KeyExtent,List<ServerConditionalMutation>> deferred = new HashMap<>();
// can not process two mutations for the same row, because one will not see what the other writes
ConditionalMutationSet.deferDuplicatesRows(updates, deferred);
@@ -1309,14 +1308,14 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
long opid = writeTracker.startWrite(TabletType.type(new KeyExtent(tid, null, null)));
try {
- Map<KeyExtent,List<ServerConditionalMutation>> updates = Translator.translate(mutations, Translators.TKET,
- new Translator.ListTranslator<TConditionalMutation,ServerConditionalMutation>(ServerConditionalMutation.TCMT));
+ Map<KeyExtent,List<ServerConditionalMutation>> updates = Translator.translate(mutations, Translators.TKET, new Translator.ListTranslator<>(
+ ServerConditionalMutation.TCMT));
for (KeyExtent ke : updates.keySet())
if (!ke.getTableId().equals(tid))
throw new IllegalArgumentException("Unexpected table id " + tid + " != " + ke.getTableId());
- ArrayList<TCMResult> results = new ArrayList<TCMResult>();
+ ArrayList<TCMResult> results = new ArrayList<>();
Map<KeyExtent,List<ServerConditionalMutation>> deferred = conditionalUpdate(cs, updates, results, symbols);
@@ -1396,9 +1395,9 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
public List<TabletStats> getTabletStats(TInfo tinfo, TCredentials credentials, String tableId) throws ThriftSecurityException, TException {
TreeMap<KeyExtent,Tablet> onlineTabletsCopy;
synchronized (onlineTablets) {
- onlineTabletsCopy = new TreeMap<KeyExtent,Tablet>(onlineTablets);
+ onlineTabletsCopy = new TreeMap<>(onlineTablets);
}
- List<TabletStats> result = new ArrayList<TabletStats>();
+ List<TabletStats> result = new ArrayList<>();
String text = tableId;
KeyExtent start = new KeyExtent(text, new Text(), null);
for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.tailMap(start).entrySet()) {
@@ -1490,7 +1489,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
Set<KeyExtent> openingOverlapping = KeyExtent.findOverlapping(extent, openingTablets);
Set<KeyExtent> onlineOverlapping = KeyExtent.findOverlapping(extent, onlineTablets);
- Set<KeyExtent> all = new HashSet<KeyExtent>();
+ Set<KeyExtent> all = new HashSet<>();
all.addAll(unopenedOverlapping);
all.addAll(openingOverlapping);
all.addAll(onlineOverlapping);
@@ -1572,7 +1571,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
throw new RuntimeException(e);
}
- ArrayList<Tablet> tabletsToFlush = new ArrayList<Tablet>();
+ ArrayList<Tablet> tabletsToFlush = new ArrayList<>();
KeyExtent ke = new KeyExtent(tableId, ByteBufferUtil.toText(endRow), ByteBufferUtil.toText(startRow));
@@ -1694,7 +1693,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
KeyExtent ke = new KeyExtent(tableId, ByteBufferUtil.toText(endRow), ByteBufferUtil.toText(startRow));
- ArrayList<Tablet> tabletsToCompact = new ArrayList<Tablet>();
+ ArrayList<Tablet> tabletsToCompact = new ArrayList<>();
synchronized (onlineTablets) {
for (Tablet tablet : onlineTablets.values())
if (ke.overlaps(tablet.getExtent()))
@@ -1728,7 +1727,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
}
List<CompactionInfo> compactions = Compactor.getRunningCompactions();
- List<ActiveCompaction> ret = new ArrayList<ActiveCompaction>(compactions.size());
+ List<ActiveCompaction> ret = new ArrayList<>(compactions.size());
for (CompactionInfo compactionInfo : compactions) {
ret.add(compactionInfo.toThrift());
@@ -1805,7 +1804,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
try {
sleepUninterruptibly(getConfiguration().getTimeInMillis(Property.TSERV_MAJC_DELAY), TimeUnit.MILLISECONDS);
- TreeMap<KeyExtent,Tablet> copyOnlineTablets = new TreeMap<KeyExtent,Tablet>();
+ TreeMap<KeyExtent,Tablet> copyOnlineTablets = new TreeMap<>();
synchronized (onlineTablets) {
copyOnlineTablets.putAll(onlineTablets); // avoid
@@ -2078,7 +2077,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
// check Metadata table before accepting assignment
Text locationToOpen = null;
- SortedMap<Key,Value> tabletsKeyValues = new TreeMap<Key,Value>();
+ SortedMap<Key,Value> tabletsKeyValues = new TreeMap<>();
try {
Pair<Text,KeyExtent> pair = verifyTabletInformation(TabletServer.this, extent, TabletServer.this.getTabletSession(), tabletsKeyValues,
getClientAddressString(), getLock());
@@ -2089,7 +2088,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
openingTablets.remove(extent);
openingTablets.notifyAll();
// it expected that the new extent will overlap the old one... if it does not, it should not be added to unopenedTablets
- if (!KeyExtent.findOverlapping(extent, new TreeSet<KeyExtent>(Arrays.asList(pair.getSecond()))).contains(pair.getSecond())) {
+ if (!KeyExtent.findOverlapping(extent, new TreeSet<>(Arrays.asList(pair.getSecond()))).contains(pair.getSecond())) {
throw new IllegalStateException("Fixed split does not overlap " + extent + " " + pair.getSecond());
}
unopenedTablets.add(pair.getSecond());
@@ -2264,9 +2263,9 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
final Processor<Iface> processor;
if (ThriftServerType.SASL == getThriftServerType()) {
Iface tcredProxy = TCredentialsUpdatingWrapper.service(rpcProxy, ThriftClientHandler.class, getConfiguration());
- processor = new Processor<Iface>(tcredProxy);
+ processor = new Processor<>(tcredProxy);
} else {
- processor = new Processor<Iface>(rpcProxy);
+ processor = new Processor<>(rpcProxy);
}
HostAndPort address = startServer(getServerConfigurationFactory().getConfiguration(), clientAddress.getHostText(), Property.TSERV_CLIENTPORT, processor,
"Thrift Client Server");
@@ -2278,7 +2277,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
final ReplicationServicerHandler handler = new ReplicationServicerHandler(this);
ReplicationServicer.Iface rpcProxy = RpcWrapper.service(handler, new ReplicationServicer.Processor<ReplicationServicer.Iface>(handler));
ReplicationServicer.Iface repl = TCredentialsUpdatingWrapper.service(rpcProxy, handler.getClass(), getConfiguration());
- ReplicationServicer.Processor<ReplicationServicer.Iface> processor = new ReplicationServicer.Processor<ReplicationServicer.Iface>(repl);
+ ReplicationServicer.Processor<ReplicationServicer.Iface> processor = new ReplicationServicer.Processor<>(repl);
AccumuloConfiguration conf = getServerConfigurationFactory().getConfiguration();
Property maxMessageSizeProperty = (conf.get(Property.TSERV_MAX_MESSAGE_SIZE) != null ? Property.TSERV_MAX_MESSAGE_SIZE : Property.GENERAL_MAX_MESSAGE_SIZE);
ServerAddress sp = TServerUtils.startServer(this, clientAddress.getHostText(), Property.REPLICATION_RECEIPT_SERVICE_PORT, processor,
@@ -2574,7 +2573,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
}
try {
- return new Pair<Text,KeyExtent>(new Text(MetadataTableUtil.getRootTabletDir()), null);
+ return new Pair<>(new Text(MetadataTableUtil.getRootTabletDir()), null);
} catch (IOException e) {
throw new AccumuloException(e);
}
@@ -2595,7 +2594,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN, TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN,
TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN, TabletsSection.ServerColumnFamily.TIME_COLUMN});
- TreeMap<Key,Value> tkv = new TreeMap<Key,Value>();
+ TreeMap<Key,Value> tkv = new TreeMap<>();
try (ScannerImpl scanner = new ScannerImpl(context, tableToVerify, Authorizations.EMPTY)) {
scanner.setRange(extent.toMetadataRange());
for (Entry<Key,Value> entry : scanner)
@@ -2636,7 +2635,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
}
if (!fke.equals(extent)) {
- return new Pair<Text,KeyExtent>(null, fke);
+ return new Pair<>(null, fke);
}
// reread and reverify metadata entries now that metadata entries were fixed
@@ -2644,7 +2643,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
return verifyTabletInformation(context, fke, instance, tabletsKeyValues, clientAddress, lock);
}
- return new Pair<Text,KeyExtent>(new Text(dir.get()), null);
+ return new Pair<>(new Text(dir.get()), null);
}
static Value checkTabletMetadata(KeyExtent extent, TServerInstance instance, SortedMap<Key,Value> tabletsKeyValues, Text metadataEntry)
@@ -2759,7 +2758,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
public void run() {
Set<String> contextProperties = getServerConfigurationFactory().getConfiguration().getAllPropertiesWithPrefix(Property.VFS_CONTEXT_CLASSPATH_PROPERTY)
.keySet();
- Set<String> configuredContexts = new HashSet<String>();
+ Set<String> configuredContexts = new HashSet<>();
for (String prop : contextProperties) {
configuredContexts.add(prop.substring(Property.VFS_CONTEXT_CLASSPATH_PROPERTY.name().length()));
}
@@ -2793,7 +2792,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
ArrayList<Tablet> tablets;
synchronized (onlineTablets) {
- tablets = new ArrayList<Tablet>(onlineTablets.values());
+ tablets = new ArrayList<>(onlineTablets.values());
}
for (Tablet tablet : tablets) {
@@ -2810,9 +2809,9 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
Map<KeyExtent,Tablet> onlineTabletsCopy;
synchronized (this.onlineTablets) {
- onlineTabletsCopy = new HashMap<KeyExtent,Tablet>(this.onlineTablets);
+ onlineTabletsCopy = new HashMap<>(this.onlineTablets);
}
- Map<String,TableInfo> tables = new HashMap<String,TableInfo>();
+ Map<String,TableInfo> tables = new HashMap<>();
for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.entrySet()) {
String tableId = entry.getKey().getTableId();
@@ -2859,7 +2858,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
table.scans.running += entry.getValue().get(ScanRunState.RUNNING);
}
- ArrayList<KeyExtent> offlineTabletsCopy = new ArrayList<KeyExtent>();
+ ArrayList<KeyExtent> offlineTabletsCopy = new ArrayList<>();
synchronized (this.unopenedTablets) {
synchronized (this.openingTablets) {
offlineTabletsCopy.addAll(this.unopenedTablets);
@@ -2955,8 +2954,8 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
public void recover(VolumeManager fs, KeyExtent extent, TableConfiguration tconf, List<LogEntry> logEntries, Set<String> tabletFiles,
MutationReceiver mutationReceiver) throws IOException {
- List<Path> recoveryLogs = new ArrayList<Path>();
- List<LogEntry> sorted = new ArrayList<LogEntry>(logEntries);
+ List<Path> recoveryLogs = new ArrayList<>();
+ List<LogEntry> sorted = new ArrayList<>(logEntries);
Collections.sort(sorted, new Comparator<LogEntry>() {
@Override
public int compare(LogEntry e1, LogEntry e2) {
@@ -3007,7 +3006,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
public Collection<Tablet> getOnlineTablets() {
synchronized (onlineTablets) {
- return new ArrayList<Tablet>(onlineTablets.values());
+ return new ArrayList<>(onlineTablets.values());
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index b3b02ea..97606ea 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -84,7 +84,7 @@ public class TabletServerResourceManager {
private final ExecutorService assignMetaDataPool;
private final ExecutorService readAheadThreadPool;
private final ExecutorService defaultReadAheadThreadPool;
- private final Map<String,ExecutorService> threadPools = new TreeMap<String,ExecutorService>();
+ private final Map<String,ExecutorService> threadPools = new TreeMap<>();
private final ConcurrentHashMap<KeyExtent,RunnableStartedAt> activeAssignments;
@@ -207,7 +207,7 @@ public class TabletServerResourceManager {
assignMetaDataPool = createEs(0, 1, 60, "metadata tablet assignment");
- activeAssignments = new ConcurrentHashMap<KeyExtent,RunnableStartedAt>();
+ activeAssignments = new ConcurrentHashMap<>();
readAheadThreadPool = createEs(Property.TSERV_READ_AHEAD_MAXCONCURRENT, "tablet read ahead");
defaultReadAheadThreadPool = createEs(Property.TSERV_METADATA_READ_AHEAD_MAXCONCURRENT, "metadata tablets read ahead");
@@ -332,7 +332,7 @@ public class TabletServerResourceManager {
MemoryManagementFramework() {
tabletReports = Collections.synchronizedMap(new HashMap<KeyExtent,TabletStateImpl>());
- memUsageReports = new LinkedBlockingQueue<TabletStateImpl>();
+ memUsageReports = new LinkedBlockingQueue<>();
maxMem = conf.getConfiguration().getMemoryInBytes(Property.TSERV_MAXMEM);
Runnable r1 = new Runnable() {
@@ -408,7 +408,7 @@ public class TabletServerResourceManager {
Map<KeyExtent,TabletStateImpl> tabletReportsCopy = null;
try {
synchronized (tabletReports) {
- tabletReportsCopy = new HashMap<KeyExtent,TabletStateImpl>(tabletReports);
+ tabletReportsCopy = new HashMap<>(tabletReports);
}
ArrayList<TabletState> tabletStates = new ArrayList<TabletState>(tabletReportsCopy.values());
mma = memoryManager.getMemoryManagementActions(tabletStates);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
index db02526..c999c09 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
@@ -39,7 +39,7 @@ class WriteTracker {
private static final Logger log = LoggerFactory.getLogger(WriteTracker.class);
private static final AtomicLong operationCounter = new AtomicLong(1);
- private final Map<TabletType,TreeSet<Long>> inProgressWrites = new EnumMap<TabletType,TreeSet<Long>>(TabletType.class);
+ private final Map<TabletType,TreeSet<Long>> inProgressWrites = new EnumMap<>(TabletType.class);
WriteTracker() {
for (TabletType ttype : TabletType.values()) {
@@ -87,7 +87,7 @@ class WriteTracker {
if (keySet.size() == 0)
return -1;
- List<KeyExtent> extents = new ArrayList<KeyExtent>(keySet.size());
+ List<KeyExtent> extents = new ArrayList<>(keySet.size());
for (Tablet tablet : keySet)
extents.add(tablet.getExtent());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/CompactionPlan.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/CompactionPlan.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/CompactionPlan.java
index 8f98761..845d779 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/CompactionPlan.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/CompactionPlan.java
@@ -31,8 +31,8 @@ import com.google.common.collect.Sets;
* create the resulting output file.
*/
public class CompactionPlan {
- public final List<FileRef> inputFiles = new ArrayList<FileRef>();
- public final List<FileRef> deleteFiles = new ArrayList<FileRef>();
+ public final List<FileRef> inputFiles = new ArrayList<>();
+ public final List<FileRef> deleteFiles = new ArrayList<>();
public WriteParameters writeParameters = null;
@Override
@@ -67,8 +67,8 @@ public class CompactionPlan {
* thrown when validation fails.
*/
public final void validate(Set<FileRef> allFiles) {
- Set<FileRef> inputSet = new HashSet<FileRef>(inputFiles);
- Set<FileRef> deleteSet = new HashSet<FileRef>(deleteFiles);
+ Set<FileRef> inputSet = new HashSet<>(inputFiles);
+ Set<FileRef> deleteSet = new HashSet<>(deleteFiles);
if (!allFiles.containsAll(inputSet)) {
inputSet.removeAll(allFiles);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/DefaultCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/DefaultCompactionStrategy.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/DefaultCompactionStrategy.java
index 1f0dc3a..faf9534 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/DefaultCompactionStrategy.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/DefaultCompactionStrategy.java
@@ -60,16 +60,16 @@ public class DefaultCompactionStrategy extends CompactionStrategy {
private List<FileRef> findMapFilesToCompact(MajorCompactionRequest request) {
MajorCompactionReason reason = request.getReason();
if (reason == MajorCompactionReason.USER) {
- return new ArrayList<FileRef>(request.getFiles().keySet());
+ return new ArrayList<>(request.getFiles().keySet());
}
if (reason == MajorCompactionReason.CHOP) {
// should not happen, but this is safe
- return new ArrayList<FileRef>(request.getFiles().keySet());
+ return new ArrayList<>(request.getFiles().keySet());
}
if (request.getFiles().size() <= 1)
return null;
- TreeSet<CompactionFile> candidateFiles = new TreeSet<CompactionFile>(new Comparator<CompactionFile>() {
+ TreeSet<CompactionFile> candidateFiles = new TreeSet<>(new Comparator<CompactionFile>() {
@Override
public int compare(CompactionFile o1, CompactionFile o2) {
if (o1 == o2)
@@ -95,7 +95,7 @@ public class DefaultCompactionStrategy extends CompactionStrategy {
totalSize += mfi.size;
}
- List<FileRef> files = new ArrayList<FileRef>();
+ List<FileRef> files = new ArrayList<>();
while (candidateFiles.size() > 1) {
CompactionFile max = candidateFiles.last();
@@ -121,7 +121,7 @@ public class DefaultCompactionStrategy extends CompactionStrategy {
if (files.size() < totalFilesToCompact) {
- TreeMap<FileRef,Long> tfc = new TreeMap<FileRef,Long>();
+ TreeMap<FileRef,Long> tfc = new TreeMap<>();
for (Entry<FileRef,DataFileValue> entry : request.getFiles().entrySet()) {
tfc.put(entry.getKey(), entry.getValue().getSize());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategy.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategy.java
index 6cc9025..69e3269 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategy.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/SizeLimitCompactionStrategy.java
@@ -39,7 +39,7 @@ public class SizeLimitCompactionStrategy extends DefaultCompactionStrategy {
}
private MajorCompactionRequest filterFiles(MajorCompactionRequest mcr) {
- Map<FileRef,DataFileValue> filteredFiles = new HashMap<FileRef,DataFileValue>();
+ Map<FileRef,DataFileValue> filteredFiles = new HashMap<>();
for (Entry<FileRef,DataFileValue> entry : mcr.getFiles().entrySet()) {
if (entry.getValue().getSize() <= limit) {
filteredFiles.put(entry.getKey(), entry.getValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
index 13e7c4f..9d065c7 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
@@ -47,7 +47,7 @@ public class ConstraintChecker {
private AtomicLong lastCheck = new AtomicLong(0);
public ConstraintChecker(TableConfiguration conf) {
- constrains = new ArrayList<Constraint>();
+ constrains = new ArrayList<>();
this.conf = conf;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
index d8a4dc6..5280d41 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java
@@ -134,7 +134,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
VolumeManager getFileSystem();
}
- private final LinkedBlockingQueue<DfsLogger.LogWork> workQueue = new LinkedBlockingQueue<DfsLogger.LogWork>();
+ private final LinkedBlockingQueue<DfsLogger.LogWork> workQueue = new LinkedBlockingQueue<>();
private final Object closeLock = new Object();
@@ -149,7 +149,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
@Override
public void run() {
- ArrayList<DfsLogger.LogWork> work = new ArrayList<DfsLogger.LogWork>();
+ ArrayList<DfsLogger.LogWork> work = new ArrayList<>();
boolean sawClosedMarker = false;
while (!sawClosedMarker) {
work.clear();
@@ -375,7 +375,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
// If it's null, we won't have any parameters whatsoever. First, let's attempt to read
// parameters
- Map<String,String> opts = new HashMap<String,String>();
+ Map<String,String> opts = new HashMap<>();
int count = input.readInt();
for (int i = 0; i < count; i++) {
String key = input.readUTF();
@@ -628,7 +628,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
public LoggerOperation logManyTablets(List<TabletMutations> mutations) throws IOException {
Durability durability = Durability.NONE;
- List<Pair<LogFileKey,LogFileValue>> data = new ArrayList<Pair<LogFileKey,LogFileValue>>();
+ List<Pair<LogFileKey,LogFileValue>> data = new ArrayList<>();
for (TabletMutations tabletMutations : mutations) {
LogFileKey key = new LogFileKey();
key.event = MANY_MUTATIONS;
@@ -636,7 +636,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
key.tid = tabletMutations.getTid();
LogFileValue value = new LogFileValue();
value.mutations = tabletMutations.getMutations();
- data.add(new Pair<LogFileKey,LogFileValue>(key, value));
+ data.add(new Pair<>(key, value));
if (tabletMutations.getDurability().ordinal() > durability.ordinal()) {
durability = tabletMutations.getDurability();
}
@@ -659,7 +659,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
key.event = COMPACTION_FINISH;
key.seq = seq;
key.tid = tid;
- return logFileData(Collections.singletonList(new Pair<LogFileKey,LogFileValue>(key, EMPTY)), durability);
+ return logFileData(Collections.singletonList(new Pair<>(key, EMPTY)), durability);
}
public LoggerOperation minorCompactionStarted(int seq, int tid, String fqfn, Durability durability) throws IOException {
@@ -668,7 +668,7 @@ public class DfsLogger implements Comparable<DfsLogger> {
key.seq = seq;
key.tid = tid;
key.filename = fqfn;
- return logFileData(Collections.singletonList(new Pair<LogFileKey,LogFileValue>(key, EMPTY)), durability);
+ return logFileData(Collections.singletonList(new Pair<>(key, EMPTY)), durability);
}
public String getLogger() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java
index f152f9c..11097ce 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java
@@ -132,7 +132,7 @@ public class LogSorter {
final long bufferSize = conf.getMemoryInBytes(Property.TSERV_SORT_BUFFER_SIZE);
Thread.currentThread().setName("Sorting " + name + " for recovery");
while (true) {
- final ArrayList<Pair<LogFileKey,LogFileValue>> buffer = new ArrayList<Pair<LogFileKey,LogFileValue>>();
+ final ArrayList<Pair<LogFileKey,LogFileValue>> buffer = new ArrayList<>();
try {
long start = input.getPos();
while (input.getPos() - start < bufferSize) {
@@ -140,7 +140,7 @@ public class LogSorter {
LogFileValue value = new LogFileValue();
key.readFields(decryptingInput);
value.readFields(decryptingInput);
- buffer.add(new Pair<LogFileKey,LogFileValue>(key, value));
+ buffer.add(new Pair<>(key, value));
}
writeBuffer(destPath, buffer, part++);
buffer.clear();
@@ -236,7 +236,7 @@ public class LogSorter {
}
public List<RecoveryStatus> getLogSorts() {
- List<RecoveryStatus> result = new ArrayList<RecoveryStatus>();
+ List<RecoveryStatus> result = new ArrayList<>();
synchronized (currentWork) {
for (Entry<String,LogProcessor> entries : currentWork.entrySet()) {
RecoveryStatus status = new RecoveryStatus();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
index ab3dea2..3d403e0 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
@@ -69,7 +69,7 @@ public class SortedLogRecovery {
private enum Status {
INITIAL, LOOKING_FOR_FINISH, COMPLETE
- };
+ }
private static class LastStartToFinish {
long lastStart = -1;
@@ -152,7 +152,7 @@ public class SortedLogRecovery {
int findLastStartToFinish(MultiReader reader, int fileno, KeyExtent extent, Set<String> tabletFiles, LastStartToFinish lastStartToFinish) throws IOException,
EmptyMapFileException, UnusedException {
- HashSet<String> suffixes = new HashSet<String>();
+ HashSet<String> suffixes = new HashSet<>();
for (String path : tabletFiles)
suffixes.add(getPathSuffix(path));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index 3b0f9d7..a4cd6b0 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@ -159,7 +159,7 @@ public class TabletServerLogger {
}
private DfsLogger initializeLoggers(final AtomicInteger logIdOut) throws IOException {
- final AtomicReference<DfsLogger> result = new AtomicReference<DfsLogger>();
+ final AtomicReference<DfsLogger> result = new AtomicReference<>();
testLockAndRun(logIdLock, new TestCallWithWriteLock() {
@Override
boolean test() {
@@ -490,7 +490,7 @@ public class TabletServerLogger {
public int logManyTablets(Map<CommitSession,Mutations> mutations) throws IOException {
- final Map<CommitSession,Mutations> loggables = new HashMap<CommitSession,Mutations>(mutations);
+ final Map<CommitSession,Mutations> loggables = new HashMap<>(mutations);
for (Entry<CommitSession,Mutations> entry : mutations.entrySet()) {
if (entry.getValue().getDurability() == Durability.NONE) {
loggables.remove(entry.getKey());
@@ -502,7 +502,7 @@ public class TabletServerLogger {
int seq = write(loggables.keySet(), false, new Writer() {
@Override
public LoggerOperation write(DfsLogger logger, int ignored) throws Exception {
- List<TabletMutations> copy = new ArrayList<TabletMutations>(loggables.size());
+ List<TabletMutations> copy = new ArrayList<>(loggables.size());
for (Entry<CommitSession,Mutations> entry : loggables.entrySet()) {
CommitSession cs = entry.getKey();
Durability durability = entry.getValue().getDurability();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileValue.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileValue.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileValue.java
index 87e17b3..f49eb71 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileValue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileValue.java
@@ -39,7 +39,7 @@ public class LogFileValue implements Writable {
@Override
public void readFields(DataInput in) throws IOException {
int count = in.readInt();
- mutations = new ArrayList<Mutation>(count);
+ mutations = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
ServerMutation mutation = new ServerMutation();
mutation.readFields(in);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
index 01db8aa..d5a4db9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
@@ -59,7 +59,7 @@ public class LogReader {
@Parameter(names = "-p", description = "search for a row that matches the given regex")
String regexp;
@Parameter(description = "<logfile> { <logfile> ... }")
- List<String> files = new ArrayList<String>();
+ List<String> files = new ArrayList<>();
}
/**
@@ -91,7 +91,7 @@ public class LogReader {
rowMatcher = pattern.matcher("");
}
- Set<Integer> tabletIds = new HashSet<Integer>();
+ Set<Integer> tabletIds = new HashSet<>();
for (String file : opts.files) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
index 589f07f..5808f2e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
@@ -691,7 +691,7 @@ public class AccumuloReplicaSystem implements ReplicaSystem {
protected WalReplication getWalEdits(ReplicationTarget target, DataInputStream wal, Path p, Status status, long sizeLimit, Set<Integer> desiredTids)
throws IOException {
WalEdits edits = new WalEdits();
- edits.edits = new ArrayList<ByteBuffer>();
+ edits.edits = new ArrayList<>();
long size = 0l;
long entriesConsumed = 0l;
long numUpdates = 0l;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
index 378e98d..139512f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
@@ -78,9 +78,9 @@ public class LookupTask extends ScanTask<MultiScanResult> {
long startTime = System.currentTimeMillis();
- List<KVEntry> results = new ArrayList<KVEntry>();
- Map<KeyExtent,List<Range>> failures = new HashMap<KeyExtent,List<Range>>();
- List<KeyExtent> fullScans = new ArrayList<KeyExtent>();
+ List<KVEntry> results = new ArrayList<>();
+ Map<KeyExtent,List<Range>> failures = new HashMap<>();
+ List<KeyExtent> fullScans = new ArrayList<>();
KeyExtent partScan = null;
Key partNextKey = null;
boolean partNextKeyInclusive = false;
@@ -146,10 +146,10 @@ public class LookupTask extends ScanTask<MultiScanResult> {
session.numEntries += results.size();
// convert everything to thrift before adding result
- List<TKeyValue> retResults = new ArrayList<TKeyValue>();
+ List<TKeyValue> retResults = new ArrayList<>();
for (KVEntry entry : results)
retResults.add(new TKeyValue(entry.getKey().toThrift(), ByteBuffer.wrap(entry.getValue().get())));
- Map<TKeyExtent,List<TRange>> retFailures = Translator.translate(failures, Translators.KET, new Translator.ListTranslator<Range,TRange>(Translators.RT));
+ Map<TKeyExtent,List<TRange>> retFailures = Translator.translate(failures, Translators.KET, new Translator.ListTranslator<>(Translators.RT));
List<TKeyExtent> retFullScans = Translator.translate(fullScans, Translators.KET);
TKeyExtent retPartScan = null;
TKey retPartNextKey = null;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
index 6d5adce..cd99ba2 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/ScanTask.java
@@ -43,9 +43,9 @@ public abstract class ScanTask<T> implements RunnableFuture<T> {
ScanTask(TabletServer server) {
this.server = server;
interruptFlag = new AtomicBoolean(false);
- runState = new AtomicReference<ScanRunState>(ScanRunState.QUEUED);
+ runState = new AtomicReference<>(ScanRunState.QUEUED);
state = new AtomicInteger(INITIAL);
- resultQueue = new ArrayBlockingQueue<Object>(1);
+ resultQueue = new ArrayBlockingQueue<>(1);
}
protected void addResult(Object o) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
index bb84085..d698a1f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
@@ -32,7 +32,7 @@ import org.apache.accumulo.tserver.scan.ScanTask;
public class MultiScanSession extends Session {
public final KeyExtent threadPoolExtent;
- public final HashSet<Column> columnSet = new HashSet<Column>();
+ public final HashSet<Column> columnSet = new HashSet<>();
public final Map<KeyExtent,List<Range>> queries;
public final List<IterInfo> ssiList;
public final Map<String,Map<String,String>> ssio;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
index 1d9c2f7..bf37855 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
@@ -50,10 +50,10 @@ public class SessionManager {
private static final Logger log = LoggerFactory.getLogger(SessionManager.class);
private final SecureRandom random = new SecureRandom();
- private final Map<Long,Session> sessions = new HashMap<Long,Session>();
+ private final Map<Long,Session> sessions = new HashMap<>();
private final long maxIdle;
private final long maxUpdateIdle;
- private final List<Session> idleSessions = new ArrayList<Session>();
+ private final List<Session> idleSessions = new ArrayList<>();
private final Long expiredSessionMarker = Long.valueOf(-1);
private final AccumuloConfiguration aconf;
@@ -169,7 +169,7 @@ public class SessionManager {
}
private void sweep(final long maxIdle, final long maxUpdateIdle) {
- List<Session> sessionsToCleanup = new ArrayList<Session>();
+ List<Session> sessionsToCleanup = new ArrayList<>();
synchronized (this) {
Iterator<Session> iter = sessions.values().iterator();
while (iter.hasNext()) {
@@ -231,8 +231,8 @@ public class SessionManager {
}
public synchronized Map<String,MapCounter<ScanRunState>> getActiveScansPerTable() {
- Map<String,MapCounter<ScanRunState>> counts = new HashMap<String,MapCounter<ScanRunState>>();
- Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<Entry<Long,Session>>();
+ Map<String,MapCounter<ScanRunState>> counts = new HashMap<>();
+ Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<>();
synchronized (idleSessions) {
/**
@@ -270,7 +270,7 @@ public class SessionManager {
MapCounter<ScanRunState> stateCounts = counts.get(tableID);
if (stateCounts == null) {
- stateCounts = new MapCounter<ScanRunState>();
+ stateCounts = new MapCounter<>();
counts.put(tableID, stateCounts);
}
@@ -282,9 +282,9 @@ public class SessionManager {
public synchronized List<ActiveScan> getActiveScans() {
- final List<ActiveScan> activeScans = new ArrayList<ActiveScan>();
+ final List<ActiveScan> activeScans = new ArrayList<>();
final long ct = System.currentTimeMillis();
- final Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<Entry<Long,Session>>();
+ final Set<Entry<Long,Session>> copiedIdleSessions = new HashSet<>();
synchronized (idleSessions) {
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
index 4a9b265..c53f560 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/UpdateSession.java
@@ -33,14 +33,14 @@ import org.apache.accumulo.tserver.tablet.Tablet;
public class UpdateSession extends Session {
public final TservConstraintEnv cenv;
- public final MapCounter<Tablet> successfulCommits = new MapCounter<Tablet>();
- public final Map<KeyExtent,Long> failures = new HashMap<KeyExtent,Long>();
- public final HashMap<KeyExtent,SecurityErrorCode> authFailures = new HashMap<KeyExtent,SecurityErrorCode>();
+ public final MapCounter<Tablet> successfulCommits = new MapCounter<>();
+ public final Map<KeyExtent,Long> failures = new HashMap<>();
+ public final HashMap<KeyExtent,SecurityErrorCode> authFailures = new HashMap<>();
public final Stat prepareTimes = new Stat();
public final Stat walogTimes = new Stat();
public final Stat commitTimes = new Stat();
public final Stat authTimes = new Stat();
- public final Map<Tablet,List<Mutation>> queuedMutations = new HashMap<Tablet,List<Mutation>>();
+ public final Map<Tablet,List<Mutation>> queuedMutations = new HashMap<>();
public final Violations violations;
public Tablet currentTablet = null;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
index c7ca29d..5c4f7c4 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionInfo.java
@@ -114,14 +114,14 @@ public class CompactionInfo {
}
}
- List<IterInfo> iiList = new ArrayList<IterInfo>();
- Map<String,Map<String,String>> iterOptions = new HashMap<String,Map<String,String>>();
+ List<IterInfo> iiList = new ArrayList<>();
+ Map<String,Map<String,String>> iterOptions = new HashMap<>();
for (IteratorSetting iterSetting : compactor.getIterators()) {
iiList.add(new IterInfo(iterSetting.getPriority(), iterSetting.getIteratorClass(), iterSetting.getName()));
iterOptions.put(iterSetting.getName(), iterSetting.getOptions());
}
- List<String> filesToCompact = new ArrayList<String>();
+ List<String> filesToCompact = new ArrayList<>();
for (FileRef ref : compactor.getFilesToCompact())
filesToCompact.add(ref.toString());
return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.getStartTime(), filesToCompact, compactor.getOutputFile(),
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
index 6ca4407..64345c2 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionWatcher.java
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
*
*/
public class CompactionWatcher implements Runnable {
- private final Map<List<Long>,ObservedCompactionInfo> observedCompactions = new HashMap<List<Long>,ObservedCompactionInfo>();
+ private final Map<List<Long>,ObservedCompactionInfo> observedCompactions = new HashMap<>();
private final AccumuloConfiguration config;
private static boolean watching = false;
@@ -55,7 +55,7 @@ public class CompactionWatcher implements Runnable {
public void run() {
List<CompactionInfo> runningCompactions = Compactor.getRunningCompactions();
- Set<List<Long>> newKeys = new HashSet<List<Long>>();
+ Set<List<Long>> newKeys = new HashSet<>();
long time = System.currentTimeMillis();
@@ -69,7 +69,7 @@ public class CompactionWatcher implements Runnable {
}
// look for compactions that finished or made progress and logged a warning
- HashMap<List<Long>,ObservedCompactionInfo> copy = new HashMap<List<Long>,ObservedCompactionInfo>(observedCompactions);
+ HashMap<List<Long>,ObservedCompactionInfo> copy = new HashMap<>(observedCompactions);
copy.keySet().removeAll(newKeys);
for (ObservedCompactionInfo oci : copy.values()) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
index 79d22ea..6c83f19 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
@@ -133,7 +133,7 @@ public class Compactor implements Callable<CompactionStats> {
protected static final Set<Compactor> runningCompactions = Collections.synchronizedSet(new HashSet<Compactor>());
public static List<CompactionInfo> getRunningCompactions() {
- ArrayList<CompactionInfo> compactions = new ArrayList<CompactionInfo>();
+ ArrayList<CompactionInfo> compactions = new ArrayList<>();
synchronized (runningCompactions) {
for (Compactor compactor : runningCompactions) {
@@ -209,7 +209,7 @@ public class Compactor implements Callable<CompactionStats> {
long t1 = System.currentTimeMillis();
- HashSet<ByteSequence> allColumnFamilies = new HashSet<ByteSequence>();
+ HashSet<ByteSequence> allColumnFamilies = new HashSet<>();
if (mfw.supportsLocalityGroups()) {
for (Entry<String,Set<ByteSequence>> entry : lGroups.entrySet()) {
@@ -277,7 +277,7 @@ public class Compactor implements Callable<CompactionStats> {
private List<SortedKeyValueIterator<Key,Value>> openMapDataFiles(String lgName, ArrayList<FileSKVIterator> readers) throws IOException {
- List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(filesToCompact.size());
+ List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<>(filesToCompact.size());
for (FileRef mapFile : filesToCompact.keySet()) {
try {
@@ -326,7 +326,7 @@ public class Compactor implements Callable<CompactionStats> {
private void compactLocalityGroup(String lgName, Set<ByteSequence> columnFamilies, boolean inclusive, FileSKVWriter mfw, CompactionStats majCStats)
throws IOException, CompactionCanceledException {
- ArrayList<FileSKVIterator> readers = new ArrayList<FileSKVIterator>(filesToCompact.size());
+ ArrayList<FileSKVIterator> readers = new ArrayList<>(filesToCompact.size());
Span span = Trace.start("compact");
try {
long entriesCompacted = 0;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
index 8716695..be22778 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CountingIterator.java
@@ -47,7 +47,7 @@ public class CountingIterator extends WrappingIterator {
}
public CountingIterator(SortedKeyValueIterator<Key,Value> source, AtomicLong entriesRead) {
- deepCopies = new ArrayList<CountingIterator>();
+ deepCopies = new ArrayList<>();
this.setSource(source);
count = 0;
this.entriesRead = entriesRead;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index fd1ea33..b488e13 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -70,13 +70,13 @@ class DatafileManager {
}
private FileRef mergingMinorCompactionFile = null;
- private final Set<FileRef> filesToDeleteAfterScan = new HashSet<FileRef>();
- private final Map<Long,Set<FileRef>> scanFileReservations = new HashMap<Long,Set<FileRef>>();
- private final MapCounter<FileRef> fileScanReferenceCounts = new MapCounter<FileRef>();
+ private final Set<FileRef> filesToDeleteAfterScan = new HashSet<>();
+ private final Map<Long,Set<FileRef>> scanFileReservations = new HashMap<>();
+ private final MapCounter<FileRef> fileScanReferenceCounts = new MapCounter<>();
private long nextScanReservationId = 0;
private boolean reservationsBlocked = false;
- private final Set<FileRef> majorCompactingFiles = new HashSet<FileRef>();
+ private final Set<FileRef> majorCompactingFiles = new HashSet<>();
static void rename(VolumeManager fs, Path src, Path dst) throws IOException {
if (!fs.rename(src, dst)) {
@@ -95,26 +95,26 @@ class DatafileManager {
}
}
- Set<FileRef> absFilePaths = new HashSet<FileRef>(datafileSizes.keySet());
+ Set<FileRef> absFilePaths = new HashSet<>(datafileSizes.keySet());
long rid = nextScanReservationId++;
scanFileReservations.put(rid, absFilePaths);
- Map<FileRef,DataFileValue> ret = new HashMap<FileRef,DataFileValue>();
+ Map<FileRef,DataFileValue> ret = new HashMap<>();
for (FileRef path : absFilePaths) {
fileScanReferenceCounts.increment(path, 1);
ret.put(path, datafileSizes.get(path));
}
- return new Pair<Long,Map<FileRef,DataFileValue>>(rid, ret);
+ return new Pair<>(rid, ret);
}
}
void returnFilesForScan(Long reservationId) {
- final Set<FileRef> filesToDelete = new HashSet<FileRef>();
+ final Set<FileRef> filesToDelete = new HashSet<>();
synchronized (tablet) {
Set<FileRef> absFilePaths = scanFileReservations.remove(reservationId);
@@ -147,7 +147,7 @@ class DatafileManager {
if (scanFiles.size() == 0)
return;
- Set<FileRef> filesToDelete = new HashSet<FileRef>();
+ Set<FileRef> filesToDelete = new HashSet<>();
synchronized (tablet) {
for (FileRef path : scanFiles) {
@@ -166,7 +166,7 @@ class DatafileManager {
private TreeSet<FileRef> waitForScansToFinish(Set<FileRef> pathsToWaitFor, boolean blockNewScans, long maxWaitTime) {
long startTime = System.currentTimeMillis();
- TreeSet<FileRef> inUse = new TreeSet<FileRef>();
+ TreeSet<FileRef> inUse = new TreeSet<>();
Span waitForScans = Trace.start("waitForScans");
try {
@@ -209,7 +209,7 @@ class DatafileManager {
String bulkDir = null;
- Map<FileRef,DataFileValue> paths = new HashMap<FileRef,DataFileValue>();
+ Map<FileRef,DataFileValue> paths = new HashMap<>();
for (Entry<FileRef,DataFileValue> entry : pathsString.entrySet())
paths.put(entry.getKey(), entry.getValue());
@@ -575,14 +575,14 @@ class DatafileManager {
public SortedMap<FileRef,DataFileValue> getDatafileSizes() {
synchronized (tablet) {
- TreeMap<FileRef,DataFileValue> copy = new TreeMap<FileRef,DataFileValue>(datafileSizes);
+ TreeMap<FileRef,DataFileValue> copy = new TreeMap<>(datafileSizes);
return Collections.unmodifiableSortedMap(copy);
}
}
public Set<FileRef> getFiles() {
synchronized (tablet) {
- HashSet<FileRef> files = new HashSet<FileRef>(datafileSizes.keySet());
+ HashSet<FileRef> files = new HashSet<>(datafileSizes.keySet());
return Collections.unmodifiableSet(files);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
index 9ba8e38..56dbec9 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/RootFiles.java
@@ -80,7 +80,7 @@ public class RootFiles {
/*
* called in constructor and before major compactions
*/
- Collection<String> goodFiles = new ArrayList<String>(files.length);
+ Collection<String> goodFiles = new ArrayList<>(files.length);
for (FileStatus file : files) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b102e760/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
index 28cbdc9..e48d91e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
@@ -169,7 +169,7 @@ class ScanDataSource implements DataSource {
for (SortedKeyValueIterator<Key,Value> skvi : Iterables.concat(mapfiles, memIters))
((InterruptibleIterator) skvi).setInterruptFlag(interruptFlag);
- List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(mapfiles.size() + memIters.size());
+ List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<>(mapfiles.size() + memIters.size());
iters.addAll(mapfiles);
iters.addAll(memIters);