accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwa...@apache.org
Subject [accumulo] branch master updated: fixes #434 - Anonymous types replaced with lamdba (#610)
Date Wed, 29 Aug 2018 14:40:32 GMT
This is an automated email from the ASF dual-hosted git repository.

mwalch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 355fd10  fixes #434 - Anonymous types replaced with lamdba (#610)
355fd10 is described below

commit 355fd104fc24d06204b032221f2d61e4cfe57210
Author: Christopher McTague <cjmctague@apache.org>
AuthorDate: Wed Aug 29 10:40:28 2018 -0400

    fixes #434 - Anonymous types replaced with lamdba (#610)
    
    - Accumulo-core java 8 simplification/translation
    - Accumulo-minicluster java 8 simplification/translation
    - accumulo-start java 8 simplification/translation
---
 .../org/apache/accumulo/core/client/impl/Bulk.java |   2 +-
 .../accumulo/core/client/impl/BulkImport.java      |   2 +-
 .../accumulo/core/client/impl/ClientContext.java   |   2 +-
 .../core/client/impl/ConditionalWriterImpl.java    |  14 +--
 .../core/client/impl/TableOperationsImpl.java      |   5 +-
 .../impl/TabletServerBatchReaderIterator.java      |  25 ++--
 .../core/client/impl/TabletServerBatchWriter.java  |  20 ++--
 .../core/client/summary/CountingSummarizer.java    |  54 ++++-----
 .../accumulo/core/conf/DefaultConfiguration.java   |   2 +-
 .../accumulo/core/file/BloomFilterLayer.java       | 126 ++++++++++-----------
 .../file/blockfile/impl/CachableBlockFile.java     |   2 +-
 .../core/metadata/MetadataLocationObtainer.java    |  16 +--
 .../core/rpc/UGIAssumingTransportFactory.java      |   7 +-
 .../core/spi/scan/HintScanPrioritizer.java         |   2 +-
 .../core/spi/scan/IdleRatioScanPrioritizer.java    |   2 +-
 .../org/apache/accumulo/core/summary/Gatherer.java |  41 ++++---
 .../accumulo/core/summary/SummaryReader.java       |   4 +-
 .../accumulo/core/trace/DistributedTrace.java      |   9 +-
 .../core/util/format/DefaultFormatter.java         |   7 +-
 .../java/org/apache/accumulo/fate/AgeOffStore.java |   7 +-
 .../main/java/org/apache/accumulo/fate/Fate.java   |  16 +--
 .../apache/accumulo/fate/zookeeper/ZooReader.java  |  10 +-
 .../accumulo/core/client/TestThrift1474.java       |   7 +-
 .../client/summary/CountingSummarizerTest.java     |   4 +-
 .../apache/accumulo/core/conf/PropertyTest.java    |   2 +-
 .../accumulo/core/conf/PropertyTypeTest.java       |   2 +-
 .../core/file/rfile/MultiThreadedRFileTest.java    |  19 ++--
 .../zookeeper/DistributedReadWriteLockTest.java    |  37 +++---
 .../fate/zookeeper/ZooReaderWriterTest.java        |  21 +---
 .../accumulo/minicluster/MiniAccumuloRunner.java   |  39 +++----
 .../minicluster/impl/MiniAccumuloClusterImpl.java  |  32 +++---
 .../start/classloader/AccumuloClassLoader.java     |   9 +-
 .../vfs/AccumuloReloadingVFSClassLoader.java       |  13 +--
 .../classloader/vfs/AccumuloVFSClassLoader.java    |  15 +--
 .../vfs/AccumuloReloadingVFSClassLoaderTest.java   |  36 +-----
 .../start/classloader/vfs/ContextManagerTest.java  |  45 +++-----
 36 files changed, 255 insertions(+), 401 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Bulk.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Bulk.java
index dcea41c..8dfb1e5 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Bulk.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Bulk.java
@@ -154,7 +154,7 @@ public class Bulk {
     Map<String,FileInfo> files = new HashMap<>();
 
     public Files(Collection<FileInfo> files) {
-      files.forEach(fi -> add(fi));
+      files.forEach(this::add);
     }
 
     public Files() {}
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/BulkImport.java b/core/src/main/java/org/apache/accumulo/core/client/impl/BulkImport.java
index 8c3abd5..8db4acc 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/BulkImport.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/BulkImport.java
@@ -126,7 +126,7 @@ public class BulkImport implements ImportSourceArguments, ImportExecutorOptions
       SortedMap<KeyExtent,Bulk.Files> mappings = computeFileToTabletMappings(fs, tableId, srcPath,
           executor, context);
 
-      BulkSerialize.writeLoadMapping(mappings, srcPath.toString(), p -> fs.create(p));
+      BulkSerialize.writeLoadMapping(mappings, srcPath.toString(), fs::create);
 
       List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getUtf8()),
           ByteBuffer.wrap(srcPath.toString().getBytes(UTF_8)),
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
index 68c0aa5..07986fd 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ClientContext.java
@@ -78,7 +78,7 @@ public class ClientContext {
 
   private static <T> Supplier<T> memoizeWithExpiration(Supplier<T> s) {
     // This insanity exists to make modernizer plugin happy. We are living in the future now.
-    return () -> Suppliers.memoizeWithExpiration(() -> s.get(), 100, TimeUnit.MILLISECONDS).get();
+    return () -> Suppliers.memoizeWithExpiration(s::get, 100, TimeUnit.MILLISECONDS).get();
   }
 
   public ClientContext(ClientInfo info) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 0a1f658..18ef8f9 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -399,15 +399,11 @@ class ConditionalWriterImpl implements ConditionalWriter {
     this.durability = config.getDurability();
     this.classLoaderContext = config.getClassLoaderContext();
 
-    Runnable failureHandler = new Runnable() {
-
-      @Override
-      public void run() {
-        List<QCMutation> mutations = new ArrayList<>();
-        failedMutations.drainTo(mutations);
-        if (mutations.size() > 0)
-          queue(mutations);
-      }
+    Runnable failureHandler = () -> {
+      List<QCMutation> mutations = new ArrayList<>();
+      failedMutations.drainTo(mutations);
+      if (mutations.size() > 0)
+        queue(mutations);
     };
 
     failureHandler = new LoggingRunnable(log, failureHandler);
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 80cfc7a..a75b538 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -1887,9 +1887,10 @@ public class TableOperationsImpl extends TableOperationsHelper {
         SummarizerConfiguration.fromTableProperties(getProperties(tableName)));
     HashSet<SummarizerConfiguration> newConfigSet = new HashSet<>(Arrays.asList(newConfigs));
 
-    newConfigSet.removeIf(sc -> currentConfigs.contains(sc));
+    newConfigSet.removeIf(currentConfigs::contains);
 
-    Set<String> newIds = newConfigSet.stream().map(sc -> sc.getPropertyId()).collect(toSet());
+    Set<String> newIds = newConfigSet.stream().map(SummarizerConfiguration::getPropertyId)
+        .collect(toSet());
 
     for (SummarizerConfiguration csc : currentConfigs) {
       if (newIds.contains(csc.getPropertyId())) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
index 7438fd1..c645b4b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
@@ -131,23 +131,18 @@ public class TabletServerBatchReaderIterator implements Iterator<Entry<Key,Value
       ranges = ranges2;
     }
 
-    ResultReceiver rr = new ResultReceiver() {
-
-      @Override
-      public void receive(List<Entry<Key,Value>> entries) {
-        try {
-          resultsQueue.put(entries);
-        } catch (InterruptedException e) {
-          if (TabletServerBatchReaderIterator.this.queryThreadPool.isShutdown())
-            log.debug("Failed to add Batch Scan result", e);
-          else
-            log.warn("Failed to add Batch Scan result", e);
-          fatalException = e;
-          throw new RuntimeException(e);
+    ResultReceiver rr = entries -> {
+      try {
+        resultsQueue.put(entries);
+      } catch (InterruptedException e) {
+        if (TabletServerBatchReaderIterator.this.queryThreadPool.isShutdown())
+          log.debug("Failed to add Batch Scan result", e);
+        else
+          log.warn("Failed to add Batch Scan result", e);
+        fatalException = e;
+        throw new RuntimeException(e);
 
-        }
       }
-
     };
 
     try {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
index 512b33d..a1f5be3 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
@@ -726,18 +726,14 @@ public class TabletServerBatchWriter {
     void queueMutations(final MutationSet mutationsToSend) throws InterruptedException {
       if (null == mutationsToSend)
         return;
-      binningThreadPool.execute(Trace.wrap(new Runnable() {
-
-        @Override
-        public void run() {
-          if (null != mutationsToSend) {
-            try {
-              log.trace("{} - binning {} mutations", Thread.currentThread().getName(),
-                  mutationsToSend.size());
-              addMutations(mutationsToSend);
-            } catch (Exception e) {
-              updateUnknownErrors("Error processing mutation set", e);
-            }
+      binningThreadPool.execute(Trace.wrap(() -> {
+        if (null != mutationsToSend) {
+          try {
+            log.trace("{} - binning {} mutations", Thread.currentThread().getName(),
+                mutationsToSend.size());
+            addMutations(mutationsToSend);
+          } catch (Exception e) {
+            updateUnknownErrors("Error processing mutation set", e);
           }
         }
       }));
diff --git a/core/src/main/java/org/apache/accumulo/core/client/summary/CountingSummarizer.java b/core/src/main/java/org/apache/accumulo/core/client/summary/CountingSummarizer.java
index 5e69cf1..41b1216 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/summary/CountingSummarizer.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/summary/CountingSummarizer.java
@@ -282,41 +282,37 @@ public abstract class CountingSummarizer<K> implements Summarizer {
   @Override
   public Combiner combiner(SummarizerConfiguration sc) {
     init(sc);
-    return new Combiner() {
+    return (summary1, summary2) -> {
 
-      @Override
-      public void merge(Map<String,Long> summary1, Map<String,Long> summary2) {
-
-        for (String key : ALL_STATS) {
-          summary1.merge(key, summary2.getOrDefault(key, 0L), Long::sum);
-        }
+      for (String key : ALL_STATS) {
+        summary1.merge(key, summary2.getOrDefault(key, 0L), Long::sum);
+      }
 
-        for (Entry<String,Long> entry : summary2.entrySet()) {
-          String k2 = entry.getKey();
-          Long v2 = entry.getValue();
+      for (Entry<String,Long> entry : summary2.entrySet()) {
+        String k2 = entry.getKey();
+        Long v2 = entry.getValue();
 
-          if (k2.startsWith(COUNTER_STAT_PREFIX)) {
-            summary1.merge(k2, v2, Long::sum);
-          }
+        if (k2.startsWith(COUNTER_STAT_PREFIX)) {
+          summary1.merge(k2, v2, Long::sum);
         }
+      }
 
-        if (summary1.size() - ALL_STATS.length > maxCounters) {
-          // find the keys with the lowest counts to remove
-          List<String> keysToRemove = summary1.entrySet().stream()
-              .filter(e -> e.getKey().startsWith(COUNTER_STAT_PREFIX)) // filter out non counters
-              .sorted((e1, e2) -> Long.compare(e2.getValue(), e1.getValue())) // sort descending by
-                                                                              // count
-              .skip(maxCounters) // skip most frequent
-              .map(e -> e.getKey()).collect(Collectors.toList()); // collect the least frequent
-                                                                  // counters in a list
-
-          long removedCount = 0;
-          for (String key : keysToRemove) {
-            removedCount += summary1.remove(key);
-          }
-
-          summary1.merge(TOO_MANY_STAT, removedCount, Long::sum);
+      if (summary1.size() - ALL_STATS.length > maxCounters) {
+        // find the keys with the lowest counts to remove
+        List<String> keysToRemove = summary1.entrySet().stream()
+            .filter(e -> e.getKey().startsWith(COUNTER_STAT_PREFIX)) // filter out non counters
+            .sorted((e1, e2) -> Long.compare(e2.getValue(), e1.getValue())) // sort descending by
+                                                                            // count
+            .skip(maxCounters) // skip most frequent
+            .map(Entry::getKey).collect(Collectors.toList()); // collect the least frequent
+                                                              // counters in a list
+
+        long removedCount = 0;
+        for (String key : keysToRemove) {
+          removedCount += summary1.remove(key);
         }
+
+        summary1.merge(TOO_MANY_STAT, removedCount, Long::sum);
       }
     };
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
index 54b87cc..3e82187 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
@@ -29,7 +29,7 @@ public class DefaultConfiguration extends AccumuloConfiguration {
 
   private static final Map<String,String> resolvedProps = Arrays.stream(Property.values())
       .filter(p -> p.getType() != PropertyType.PREFIX)
-      .collect(Collectors.toMap(p -> p.getKey(), p -> p.getDefaultValue()));
+      .collect(Collectors.toMap(Property::getKey, Property::getDefaultValue));
 
   private DefaultConfiguration() {}
 
diff --git a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
index 7d1e999..8ca966d 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
@@ -219,74 +219,70 @@ public class BloomFilterLayer {
 
       final String context = acuconf.get(Property.TABLE_CLASSPATH);
 
-      loadTask = new Runnable() {
-        @Override
-        public void run() {
+      loadTask = () -> {
+        // no need to load the bloom filter if the map file is closed
+        if (closed)
+          return;
+        String ClassName = null;
+        DataInputStream in = null;
 
-          // no need to load the bloom filter if the map file is closed
+        try {
+          in = reader.getMetaStore(BLOOM_FILE_NAME);
+          DynamicBloomFilter tmpBloomFilter = new DynamicBloomFilter();
+
+          // check for closed again after open but before reading the bloom filter in
           if (closed)
             return;
-          String ClassName = null;
-          DataInputStream in = null;
-
-          try {
-            in = reader.getMetaStore(BLOOM_FILE_NAME);
-            DynamicBloomFilter tmpBloomFilter = new DynamicBloomFilter();
-
-            // check for closed again after open but before reading the bloom filter in
-            if (closed)
-              return;
-
-            /**
-             * Load classname for keyFunctor
-             */
-            ClassName = in.readUTF();
-
-            Class<? extends KeyFunctor> clazz;
-            if (context != null && !context.equals(""))
-              clazz = AccumuloVFSClassLoader.getContextManager().loadClass(context, ClassName,
-                  KeyFunctor.class);
-            else
-              clazz = AccumuloVFSClassLoader.loadClass(ClassName, KeyFunctor.class);
-            transformer = clazz.newInstance();
-
-            /**
-             * read in bloom filter
-             */
-
-            tmpBloomFilter.readFields(in);
-            // only set the bloom filter after it is fully constructed
-            bloomFilter = tmpBloomFilter;
-          } catch (NoSuchMetaStoreException nsme) {
-            // file does not have a bloom filter, ignore it
-          } catch (IOException ioe) {
-            if (!closed)
-              LOG.warn("Can't open BloomFilter", ioe);
-            else
-              LOG.debug("Can't open BloomFilter, file closed : {}", ioe.getMessage());
-
-            bloomFilter = null;
-          } catch (ClassNotFoundException e) {
-            LOG.error("Failed to find KeyFunctor in config: " + ClassName, e);
-            bloomFilter = null;
-          } catch (InstantiationException e) {
-            LOG.error("Could not instantiate KeyFunctor: " + ClassName, e);
-            bloomFilter = null;
-          } catch (IllegalAccessException e) {
-            LOG.error("Illegal acess exception", e);
-            bloomFilter = null;
-          } catch (RuntimeException rte) {
-            if (!closed)
-              throw rte;
-            else
-              LOG.debug("Can't open BloomFilter, RTE after closed ", rte);
-          } finally {
-            if (in != null) {
-              try {
-                in.close();
-              } catch (IOException e) {
-                LOG.warn("Failed to close ", e);
-              }
+
+          /**
+           * Load classname for keyFunctor
+           */
+          ClassName = in.readUTF();
+
+          Class<? extends KeyFunctor> clazz;
+          if (context != null && !context.equals(""))
+            clazz = AccumuloVFSClassLoader.getContextManager().loadClass(context, ClassName,
+                KeyFunctor.class);
+          else
+            clazz = AccumuloVFSClassLoader.loadClass(ClassName, KeyFunctor.class);
+          transformer = clazz.newInstance();
+
+          /**
+           * read in bloom filter
+           */
+
+          tmpBloomFilter.readFields(in);
+          // only set the bloom filter after it is fully constructed
+          bloomFilter = tmpBloomFilter;
+        } catch (NoSuchMetaStoreException nsme) {
+          // file does not have a bloom filter, ignore it
+        } catch (IOException ioe) {
+          if (!closed)
+            LOG.warn("Can't open BloomFilter", ioe);
+          else
+            LOG.debug("Can't open BloomFilter, file closed : {}", ioe.getMessage());
+
+          bloomFilter = null;
+        } catch (ClassNotFoundException e) {
+          LOG.error("Failed to find KeyFunctor in config: " + ClassName, e);
+          bloomFilter = null;
+        } catch (InstantiationException e) {
+          LOG.error("Could not instantiate KeyFunctor: " + ClassName, e);
+          bloomFilter = null;
+        } catch (IllegalAccessException e) {
+          LOG.error("Illegal acess exception", e);
+          bloomFilter = null;
+        } catch (RuntimeException rte) {
+          if (!closed)
+            throw rte;
+          else
+            LOG.debug("Can't open BloomFilter, RTE after closed ", rte);
+        } finally {
+          if (in != null) {
+            try {
+              in.close();
+            } catch (IOException e) {
+              LOG.warn("Failed to close ", e);
             }
           }
         }
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
index e49a0ce..eaef448 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
@@ -92,7 +92,7 @@ public class CachableBlockFile {
 
     private long getCachedFileLen() throws IOException {
       try {
-        return fileLenCache.get(cacheId, () -> lengthSupplier.get());
+        return fileLenCache.get(cacheId, lengthSupplier::get);
       } catch (ExecutionException e) {
         throw new IOException("Failed to get " + cacheId + " len from cache ", e);
       }
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
index b0f9ee3..90b7235 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
@@ -178,16 +178,12 @@ public class MetadataLocationObtainer implements TabletLocationObtainer {
 
     final TreeMap<Key,Value> results = new TreeMap<>();
 
-    ResultReceiver rr = new ResultReceiver() {
-
-      @Override
-      public void receive(List<Entry<Key,Value>> entries) {
-        for (Entry<Key,Value> entry : entries) {
-          try {
-            results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()));
-          } catch (IOException e) {
-            throw new RuntimeException(e);
-          }
+    ResultReceiver rr = entries -> {
+      for (Entry<Key,Value> entry : entries) {
+        try {
+          results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()));
+        } catch (IOException e) {
+          throw new RuntimeException(e);
         }
       }
     };
diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransportFactory.java b/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransportFactory.java
index f64e54a..49b64f2 100644
--- a/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransportFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/rpc/UGIAssumingTransportFactory.java
@@ -45,11 +45,6 @@ public class UGIAssumingTransportFactory extends TTransportFactory {
 
   @Override
   public TTransport getTransport(final TTransport trans) {
-    return ugi.doAs(new PrivilegedAction<TTransport>() {
-      @Override
-      public TTransport run() {
-        return wrapped.getTransport(trans);
-      }
-    });
+    return ugi.doAs((PrivilegedAction<TTransport>) () -> wrapped.getTransport(trans));
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java b/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
index 01b1437..22063ef 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
@@ -100,6 +100,6 @@ public class HintScanPrioritizer implements ScanPrioritizer {
     Comparator<ScanInfo> cmp = Comparator.comparingInt(si -> getPriority(si, defaultPriority, hpa));
 
     return cmp.thenComparingLong(si -> si.getLastRunTime().orElse(0))
-        .thenComparingLong(si -> si.getCreationTime());
+        .thenComparingLong(ScanInfo::getCreationTime);
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/spi/scan/IdleRatioScanPrioritizer.java b/core/src/main/java/org/apache/accumulo/core/spi/scan/IdleRatioScanPrioritizer.java
index 9f5adf7..df0714c 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/scan/IdleRatioScanPrioritizer.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/scan/IdleRatioScanPrioritizer.java
@@ -45,6 +45,6 @@ public class IdleRatioScanPrioritizer implements ScanPrioritizer {
     };
 
     return c1.thenComparingLong(si -> si.getLastRunTime().orElse(0))
-        .thenComparingLong(si -> si.getCreationTime());
+        .thenComparingLong(ScanInfo::getCreationTime);
   }
 }
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
index 84be0d6..f6888b4 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
@@ -230,28 +230,25 @@ public class Gatherer {
       return Collections.singletonList(map);
     }
 
-    return new Iterable<Map<K,V>>() {
-      @Override
-      public Iterator<Map<K,V>> iterator() {
-        Iterator<Entry<K,V>> esi = map.entrySet().iterator();
-
-        return new Iterator<Map<K,V>>() {
-          @Override
-          public boolean hasNext() {
-            return esi.hasNext();
-          }
+    return () -> {
+      Iterator<Entry<K,V>> esi = map.entrySet().iterator();
 
-          @Override
-          public Map<K,V> next() {
-            Map<K,V> workingMap = new HashMap<>(max);
-            while (esi.hasNext() && workingMap.size() < max) {
-              Entry<K,V> entry = esi.next();
-              workingMap.put(entry.getKey(), entry.getValue());
-            }
-            return workingMap;
+      return new Iterator<Map<K,V>>() {
+        @Override
+        public boolean hasNext() {
+          return esi.hasNext();
+        }
+
+        @Override
+        public Map<K,V> next() {
+          Map<K,V> workingMap = new HashMap<>(max);
+          while (esi.hasNext() && workingMap.size() < max) {
+            Entry<K,V> entry = esi.next();
+            workingMap.put(entry.getKey(), entry.getValue());
           }
-        };
-      }
+          return workingMap;
+        }
+      };
     };
   }
 
@@ -362,7 +359,7 @@ public class Gatherer {
         Predicate<String> fileSelector = file -> Math
             .abs(Hashing.murmur3_32().hashString(file).asInt()) % modulus == remainder;
         if (previousWork != null) {
-          fileSelector = fileSelector.and(file -> previousWork.failedFiles.contains(file));
+          fileSelector = fileSelector.and(previousWork.failedFiles::contains);
         }
         Map<String,Map<String,List<TRowRange>>> filesGBL;
         filesGBL = getFilesGroupedByLocation(fileSelector);
@@ -386,7 +383,7 @@ public class Gatherer {
 
         // when all processing is done, check for failed files... and if found starting processing
         // again
-        future.thenRun(() -> updateFuture());
+        future.thenRun(this::updateFuture);
       } catch (Exception e) {
         future = CompletableFuture.completedFuture(new ProcessedFiles());
         // force future to have this exception
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/SummaryReader.java b/core/src/main/java/org/apache/accumulo/core/summary/SummaryReader.java
index eb49fbb..668de1e 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummaryReader.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummaryReader.java
@@ -167,7 +167,7 @@ public class SummaryReader {
       Predicate<SummarizerConfiguration> summarySelector, SummarizerFactory factory)
       throws IOException {
     SummaryReader fileSummaries = new SummaryReader();
-    fileSummaries.summaryStores = load(name -> bcReader.getMetaBlock(name), summarySelector);
+    fileSummaries.summaryStores = load(bcReader::getMetaBlock, summarySelector);
     fileSummaries.factory = factory;
     return fileSummaries;
   }
@@ -229,7 +229,7 @@ public class SummaryReader {
 
     out.print("Summary data : \n");
 
-    List<SummarySerializer> stores = load(name -> fsi.getMetaStore(name), conf -> true);
+    List<SummarySerializer> stores = load(fsi::getMetaStore, conf -> true);
     int i = 1;
     for (SummarySerializer summaryStore : stores) {
       out.printf("%sSummary %d of %d generated by : %s\n", indent, i, stores.size(),
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
index 3a79f9d..5ce5ce3 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/DistributedTrace.java
@@ -127,12 +127,9 @@ public class DistributedTrace {
       setProperty(conf, TRACE_SERVICE_PROPERTY, service);
     }
     org.apache.htrace.Trace.setProcessId(service);
-    ShutdownHookManager.get().addShutdownHook(new Runnable() {
-      @Override
-      public void run() {
-        Trace.off();
-        closeReceivers();
-      }
+    ShutdownHookManager.get().addShutdownHook(() -> {
+      Trace.off();
+      closeReceivers();
     }, 0);
     loadSpanReceivers(conf);
   }
diff --git a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
index 6abee26..84b9c08 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
@@ -82,12 +82,7 @@ public class DefaultFormatter implements Formatter {
   }
 
   /* so a new date object doesn't get created for every record in the scan result */
-  private static ThreadLocal<Date> tmpDate = new ThreadLocal<Date>() {
-    @Override
-    protected Date initialValue() {
-      return new Date();
-    }
-  };
+  private static ThreadLocal<Date> tmpDate = ThreadLocal.withInitial(Date::new);
 
   /** Does not show timestamps if timestampFormat is null */
   public static String formatEntry(Entry<Key,Value> entry, DateFormat timestampFormat) {
diff --git a/core/src/main/java/org/apache/accumulo/fate/AgeOffStore.java b/core/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
index 399fc63..c37cacc 100644
--- a/core/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
+++ b/core/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
@@ -138,12 +138,7 @@ public class AgeOffStore<T> implements TStore<T> {
   }
 
   public AgeOffStore(TStore<T> store, long ageOffTime) {
-    this(store, ageOffTime, new TimeSource() {
-      @Override
-      public long currentTimeMillis() {
-        return System.currentTimeMillis();
-      }
-    });
+    this(store, ageOffTime, System::currentTimeMillis);
   }
 
   @Override
diff --git a/core/src/main/java/org/apache/accumulo/fate/Fate.java b/core/src/main/java/org/apache/accumulo/fate/Fate.java
index 6e13bd5..62dd36f 100644
--- a/core/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/core/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.fate;
 import java.util.EnumSet;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -174,16 +173,11 @@ public class Fate<T> {
    */
   public void startTransactionRunners(int numThreads) {
     final AtomicInteger runnerCount = new AtomicInteger(0);
-    executor = Executors.newFixedThreadPool(numThreads, new ThreadFactory() {
-
-      @Override
-      public Thread newThread(Runnable r) {
-        Thread t = new Thread(new LoggingRunnable(log, r),
-            "Repo runner " + runnerCount.getAndIncrement());
-        t.setDaemon(true);
-        return t;
-      }
-
+    executor = Executors.newFixedThreadPool(numThreads, r -> {
+      Thread t = new Thread(new LoggingRunnable(log, r),
+          "Repo runner " + runnerCount.getAndIncrement());
+      t.setDaemon(true);
+      return t;
     });
     for (int i = 0; i < numThreads; i++) {
       executor.execute(new TransactionRunner());
diff --git a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
index fee76b7..98e49d3 100644
--- a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
+++ b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java
@@ -23,7 +23,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.accumulo.fate.util.Retry;
 import org.apache.accumulo.fate.util.Retry.RetryFactory;
 import org.apache.accumulo.fate.zookeeper.ZooUtil.ZooKeeperConnectionInfo;
-import org.apache.zookeeper.AsyncCallback.VoidCallback;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.Code;
 import org.apache.zookeeper.Watcher;
@@ -239,12 +238,9 @@ public class ZooReader implements IZooReader {
   public void sync(final String path) throws KeeperException, InterruptedException {
     final AtomicInteger rc = new AtomicInteger();
     final CountDownLatch waiter = new CountDownLatch(1);
-    getZooKeeper().sync(path, new VoidCallback() {
-      @Override
-      public void processResult(int code, String arg1, Object arg2) {
-        rc.set(code);
-        waiter.countDown();
-      }
+    getZooKeeper().sync(path, (code, arg1, arg2) -> {
+      rc.set(code);
+      waiter.countDown();
     }, null);
     waiter.await();
     Code code = Code.get(rc.get());
diff --git a/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java b/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
index 2ae1a56..8e632a9 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/TestThrift1474.java
@@ -69,12 +69,7 @@ public class TestThrift1474 {
     args.stopTimeoutVal = 10;
     args.stopTimeoutUnit = TimeUnit.MILLISECONDS;
     final TServer server = new TThreadPoolServer(args.processor(processor));
-    Thread thread = new Thread() {
-      @Override
-      public void run() {
-        server.serve();
-      }
-    };
+    Thread thread = new Thread(server::serve);
     thread.start();
     while (!server.isServing()) {
       sleepUninterruptibly(10, TimeUnit.MILLISECONDS);
diff --git a/core/src/test/java/org/apache/accumulo/core/client/summary/CountingSummarizerTest.java b/core/src/test/java/org/apache/accumulo/core/client/summary/CountingSummarizerTest.java
index c9cb457..d1e6b89 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/summary/CountingSummarizerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/summary/CountingSummarizerTest.java
@@ -75,7 +75,7 @@ public class CountingSummarizerTest {
     }
 
     HashMap<String,Long> stats = new HashMap<>();
-    collector.summarize((k, v) -> stats.put(k, v));
+    collector.summarize(stats::put);
 
     CounterSummary csum = new CounterSummary(stats);
     Assert.assertEquals(expected, csum.getCounters());
@@ -104,7 +104,7 @@ public class CountingSummarizerTest {
     collector.accept(dk, new Value(""));
 
     HashMap<String,Long> stats = new HashMap<>();
-    collector.summarize((k, v) -> stats.put(k, v));
+    collector.summarize(stats::put);
 
     String p = COUNTER_STAT_PREFIX;
 
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
index 5351c96..41f4f7b 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
@@ -110,7 +110,7 @@ public class PropertyTest {
 
     // ignores duplicates because ConfigurationCopy already de-duplicates
     Collector<Entry<String,String>,?,TreeMap<String,String>> treeMapCollector = Collectors
-        .toMap(e -> e.getKey(), e -> e.getValue(), (a, b) -> a, TreeMap::new);
+        .toMap(Entry::getKey, Entry::getValue, (a, b) -> a, TreeMap::new);
 
     Predicate<Entry<String,String>> sensitiveNames = e -> e.getKey()
         .equals(Property.INSTANCE_SECRET.getKey()) || e.getKey().toLowerCase().contains("password")
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
index 854ecb7..e0bcecf 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTypeTest.java
@@ -68,7 +68,7 @@ public class PropertyTypeTest {
   public void testFullCoverage() {
     // This test checks the remainder of the methods in this class to ensure each property type has
     // a corresponding test
-    Stream<String> types = Arrays.stream(PropertyType.values()).map(v -> v.name());
+    Stream<String> types = Arrays.stream(PropertyType.values()).map(Enum::name);
 
     List<String> typesTested = Arrays.stream(this.getClass().getMethods()).map(m -> m.getName())
         .filter(m -> m.startsWith("testType")).map(m -> m.substring(8))
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
index dcd1af1..e78b1b1 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
@@ -237,18 +237,15 @@ public class MultiThreadedRFileTest {
           TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamingThreadFactory(name));
       pool.allowCoreThreadTimeOut(true);
       try {
-        Runnable runnable = new Runnable() {
-          @Override
-          public void run() {
-            try {
-              TestRFile trf = trfBase;
-              synchronized (trfBaseCopy) {
-                trf = trfBaseCopy.deepCopy();
-              }
-              validate(trf);
-            } catch (Throwable t) {
-              threadExceptions.add(t);
+        Runnable runnable = () -> {
+          try {
+            TestRFile trf = trfBase;
+            synchronized (trfBaseCopy) {
+              trf = trfBaseCopy.deepCopy();
             }
+            validate(trf);
+          } catch (Throwable t) {
+            threadExceptions.add(t);
           }
         };
         for (int i = 0; i < maxThreads; i++) {
diff --git a/core/src/test/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLockTest.java b/core/src/test/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLockTest.java
index 486a4c6..454ab2d 100644
--- a/core/src/test/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLockTest.java
+++ b/core/src/test/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLockTest.java
@@ -100,29 +100,26 @@ public class DistributedReadWriteLockTest {
     Thread[] threads = new Thread[2];
     for (int i = 0; i < threads.length; i++) {
       final int which = i;
-      threads[i] = new Thread() {
-        @Override
-        public void run() {
-          if (which % 2 == 0) {
-            final Lock wl = locker.writeLock();
-            wl.lock();
-            try {
-              data.write();
-            } finally {
-              wl.unlock();
-            }
-          } else {
-            final Lock rl = locker.readLock();
-            rl.lock();
+      threads[i] = new Thread(() -> {
+        if (which % 2 == 0) {
+          final Lock wl = locker.writeLock();
+          wl.lock();
+          try {
+            data.write();
+          } finally {
+            wl.unlock();
+          }
+        } else {
+          final Lock rl = locker.readLock();
+          rl.lock();
+          data.read();
+          try {
             data.read();
-            try {
-              data.read();
-            } finally {
-              rl.unlock();
-            }
+          } finally {
+            rl.unlock();
           }
         }
-      };
+      });
     }
     for (Thread t : threads) {
       t.start();
diff --git a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriterTest.java b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriterTest.java
index f2e5e37..dfe514e 100644
--- a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriterTest.java
+++ b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriterTest.java
@@ -101,12 +101,7 @@ public class ZooReaderWriterTest {
     final String path = "/foo";
     final byte[] value = {0};
     final List<ACL> acls = Collections.emptyList();
-    Mutator mutator = new Mutator() {
-      @Override
-      public byte[] mutate(byte[] currentValue) throws Exception {
-        return new byte[] {1};
-      }
-    };
+    Mutator mutator = currentValue -> new byte[] {1};
 
     zk.create(path, value, acls, CreateMode.PERSISTENT);
     EasyMock.expectLastCall().andThrow(new SessionExpiredException()).once();
@@ -124,12 +119,7 @@ public class ZooReaderWriterTest {
     final byte[] value = {0};
     final List<ACL> acls = Collections.emptyList();
     final byte[] mutatedBytes = {1};
-    Mutator mutator = new Mutator() {
-      @Override
-      public byte[] mutate(byte[] currentValue) throws Exception {
-        return mutatedBytes;
-      }
-    };
+    Mutator mutator = currentValue -> mutatedBytes;
 
     Method getDataMethod = ZooReaderWriter.class.getMethod("getData", String.class, boolean.class,
         Stat.class);
@@ -162,12 +152,7 @@ public class ZooReaderWriterTest {
     final byte[] value = {0};
     final List<ACL> acls = Collections.emptyList();
     final byte[] mutatedBytes = {1};
-    Mutator mutator = new Mutator() {
-      @Override
-      public byte[] mutate(byte[] currentValue) throws Exception {
-        return mutatedBytes;
-      }
-    };
+    Mutator mutator = currentValue -> mutatedBytes;
 
     Method getDataMethod = ZooReaderWriter.class.getMethod("getData", String.class, boolean.class,
         Stat.class);
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
index 02c0723..1b3636a 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java
@@ -208,29 +208,26 @@ public class MiniAccumuloRunner {
 
     final MiniAccumuloCluster accumulo = new MiniAccumuloCluster(config);
 
-    Runtime.getRuntime().addShutdownHook(new Thread() {
-      @Override
-      public void run() {
-        try {
-          accumulo.stop();
-        } catch (IOException e) {
-          log.error("IOException attempting to stop Accumulo.", e);
-          return;
-        } catch (InterruptedException e) {
-          log.error("InterruptedException attempting to stop Accumulo.", e);
-          return;
-        }
-
-        try {
-          FileUtils.deleteDirectory(miniDir);
-        } catch (IOException e) {
-          log.error("IOException attempting to clean up miniDir.", e);
-          return;
-        }
+    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+      try {
+        accumulo.stop();
+      } catch (IOException e) {
+        log.error("IOException attempting to stop Accumulo.", e);
+        return;
+      } catch (InterruptedException e) {
+        log.error("InterruptedException attempting to stop Accumulo.", e);
+        return;
+      }
 
-        System.out.println("\nShut down gracefully on " + new Date());
+      try {
+        FileUtils.deleteDirectory(miniDir);
+      } catch (IOException e) {
+        log.error("IOException attempting to clean up miniDir.", e);
+        return;
       }
-    });
+
+      System.out.println("\nShut down gracefully on " + new Date());
+    }));
 
     accumulo.start();
 
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index d1c0cd6..ac7db48 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -130,14 +130,11 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
       this.in = new BufferedReader(new InputStreamReader(stream));
       out = new BufferedWriter(new FileWriter(logFile));
 
-      SimpleTimer.getInstance(null).schedule(new Runnable() {
-        @Override
-        public void run() {
-          try {
-            flush();
-          } catch (IOException e) {
-            log.error("Exception while attempting to flush.", e);
-          }
+      SimpleTimer.getInstance(null).schedule(() -> {
+        try {
+          flush();
+        } catch (IOException e) {
+          log.error("Exception while attempting to flush.", e);
         }
       }, 1000, 1000);
     }
@@ -568,18 +565,15 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
             "The Accumulo instance being used is already running. Aborting.");
     } else {
       if (!initialized) {
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-          @Override
-          public void run() {
-            try {
-              MiniAccumuloClusterImpl.this.stop();
-            } catch (IOException e) {
-              log.error("IOException while attempting to stop the MiniAccumuloCluster.", e);
-            } catch (InterruptedException e) {
-              log.error("The stopping of MiniAccumuloCluster was interrupted.", e);
-            }
+        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+          try {
+            MiniAccumuloClusterImpl.this.stop();
+          } catch (IOException e) {
+            log.error("IOException while attempting to stop the MiniAccumuloCluster.", e);
+          } catch (InterruptedException e) {
+            log.error("The stopping of MiniAccumuloCluster was interrupted.", e);
           }
-        });
+        }));
       }
 
       if (!config.useExistingZooKeepers())
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
index 3a1b4e0..1e4dc14 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
@@ -17,7 +17,6 @@
 package org.apache.accumulo.start.classloader;
 
 import java.io.File;
-import java.io.FilenameFilter;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -172,12 +171,8 @@ public class AccumuloClassLoader {
         urls.add(extDir.toURI().toURL());
       else {
         if (extDir.getParentFile() != null) {
-          File[] extJars = extDir.getParentFile().listFiles(new FilenameFilter() {
-            @Override
-            public boolean accept(File dir, String name) {
-              return name.matches("^" + extDir.getName());
-            }
-          });
+          File[] extJars = extDir.getParentFile()
+              .listFiles((dir, name) -> name.matches("^" + extDir.getName()));
           if (extJars != null && extJars.length > 0) {
             for (File jar : extJars)
               urls.add(jar.toURI().toURL());
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
index a084db3..43ee314 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
@@ -64,15 +64,10 @@ public class AccumuloReloadingVFSClassLoader implements FileListener, ReloadingC
   private final ThreadPoolExecutor executor;
   {
     BlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(2);
-    ThreadFactory factory = new ThreadFactory() {
-
-      @Override
-      public Thread newThread(Runnable r) {
-        Thread t = new Thread(r);
-        t.setDaemon(true);
-        return t;
-      }
-
+    ThreadFactory factory = r -> {
+      Thread t = new Thread(r);
+      t.setDaemon(true);
+      return t;
     };
     executor = new ThreadPoolExecutor(1, 1, 1, SECONDS, queue, factory);
   }
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
index 3aa87eb..c3c9bc8 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
@@ -307,7 +307,7 @@ public class AccumuloVFSClassLoader {
 
   public static String getClassPath(boolean debug) {
     StringBuilder cp = new StringBuilder();
-    printClassPath(s -> cp.append(s), debug);
+    printClassPath(cp::append, debug);
     return cp.toString();
   }
 
@@ -401,14 +401,11 @@ public class AccumuloVFSClassLoader {
   public static synchronized ContextManager getContextManager() throws IOException {
     if (contextManager == null) {
       getClassLoader();
-      contextManager = new ContextManager(generateVfs(), new ReloadingClassLoader() {
-        @Override
-        public ClassLoader getClassLoader() {
-          try {
-            return AccumuloVFSClassLoader.getClassLoader();
-          } catch (IOException e) {
-            throw new RuntimeException(e);
-          }
+      contextManager = new ContextManager(generateVfs(), () -> {
+        try {
+          return getClassLoader();
+        } catch (IOException e) {
+          throw new RuntimeException(e);
         }
       });
     }
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
index 81ea37f..7a69b3b 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
@@ -72,12 +72,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     FileObject[] dirContents = testDir.getChildren();
 
     AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath, vfs,
-        new ReloadingClassLoader() {
-          @Override
-          public ClassLoader getClassLoader() {
-            return ClassLoader.getSystemClassLoader();
-          }
-        }, true);
+        ClassLoader::getSystemClassLoader, true);
 
     VFSClassLoader cl = (VFSClassLoader) arvcl.getClassLoader();
 
@@ -93,12 +88,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     FileObject[] dirContents = testDir.getChildren();
 
     AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath, vfs,
-        new ReloadingClassLoader() {
-          @Override
-          public ClassLoader getClassLoader() {
-            return ClassLoader.getSystemClassLoader();
-          }
-        }, 1000, true);
+        ClassLoader::getSystemClassLoader, 1000, true);
 
     FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
     Assert.assertArrayEquals(createFileSystems(dirContents), files);
@@ -144,12 +134,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     FileObject[] dirContents = testDir.getChildren();
 
     AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath, vfs,
-        new ReloadingClassLoader() {
-          @Override
-          public ClassLoader getClassLoader() {
-            return ClassLoader.getSystemClassLoader();
-          }
-        }, 1000, true);
+        ClassLoader::getSystemClassLoader, 1000, true);
 
     FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
     Assert.assertArrayEquals(createFileSystems(dirContents), files);
@@ -202,13 +187,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     FileObject[] dirContents = testDir.getChildren();
 
     AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath, vfs,
-        new ReloadingClassLoader() {
-
-          @Override
-          public ClassLoader getClassLoader() {
-            return ClassLoader.getSystemClassLoader();
-          }
-        }, 1000, true);
+        ClassLoader::getSystemClassLoader, 1000, true);
 
     FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
     Assert.assertArrayEquals(createFileSystems(dirContents), files);
@@ -250,12 +229,7 @@ public class AccumuloReloadingVFSClassLoaderTest {
     FileObject[] dirContents = testDir.getChildren();
 
     AccumuloReloadingVFSClassLoader arvcl = new AccumuloReloadingVFSClassLoader(folderPath, vfs,
-        new ReloadingClassLoader() {
-          @Override
-          public ClassLoader getClassLoader() {
-            return ClassLoader.getSystemClassLoader();
-          }
-        }, 1000, true);
+        ClassLoader::getSystemClassLoader, 1000, true);
 
     FileObject[] files = ((VFSClassLoader) arvcl.getClassLoader()).getFileObjects();
     Assert.assertArrayEquals(createFileSystems(dirContents), files);
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
index 221fc5c..4f85443 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
@@ -20,7 +20,6 @@ import java.io.File;
 import java.util.HashSet;
 
 import org.apache.accumulo.start.classloader.vfs.ContextManager.ContextConfig;
-import org.apache.accumulo.start.classloader.vfs.ContextManager.ContextsConfig;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
@@ -83,23 +82,15 @@ public class ContextManagerTest {
   @Test
   public void differentContexts() throws Exception {
 
-    ContextManager cm = new ContextManager(vfs, new ReloadingClassLoader() {
-      @Override
-      public ClassLoader getClassLoader() {
-        return ClassLoader.getSystemClassLoader();
-      }
-    });
+    ContextManager cm = new ContextManager(vfs, ClassLoader::getSystemClassLoader);
 
-    cm.setContextConfig(new ContextsConfig() {
-      @Override
-      public ContextConfig getContextConfig(String context) {
-        if (context.equals("CX1")) {
-          return new ContextConfig(uri1, true);
-        } else if (context.equals("CX2")) {
-          return new ContextConfig(uri2, true);
-        }
-        return null;
+    cm.setContextConfig(context -> {
+      if (context.equals("CX1")) {
+        return new ContextConfig(uri1, true);
+      } else if (context.equals("CX2")) {
+        return new ContextConfig(uri2, true);
       }
+      return null;
     });
 
     FileObject testDir = vfs.resolveFile(folder1.getRoot().toURI().toString());
@@ -133,23 +124,15 @@ public class ContextManagerTest {
 
     Class<?> pclass = parent.loadClass("test.HelloWorld");
 
-    ContextManager cm = new ContextManager(vfs, new ReloadingClassLoader() {
-      @Override
-      public ClassLoader getClassLoader() {
-        return parent;
-      }
-    });
+    ContextManager cm = new ContextManager(vfs, () -> parent);
 
-    cm.setContextConfig(new ContextsConfig() {
-      @Override
-      public ContextConfig getContextConfig(String context) {
-        if (context.equals("CX1")) {
-          return new ContextConfig(uri2.toString(), true);
-        } else if (context.equals("CX2")) {
-          return new ContextConfig(uri2.toString(), false);
-        }
-        return null;
+    cm.setContextConfig(context -> {
+      if (context.equals("CX1")) {
+        return new ContextConfig(uri2.toString(), true);
+      } else if (context.equals("CX2")) {
+        return new ContextConfig(uri2.toString(), false);
       }
+      return null;
     });
 
     Assert.assertSame(cm.getClassLoader("CX1").loadClass("test.HelloWorld"), pclass);


Mime
View raw message