hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [22/50] [abbrv] hbase git commit: HBASE-17532 Replaced explicit type with diamond operator
Date Fri, 10 Mar 2017 22:10:02 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
index f6ae9af..b0e088c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
@@ -73,7 +73,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
   protected static final int MIN_SERVER_BALANCE = 2;
   private volatile boolean stopped = false;
 
-  private static final List<HRegionInfo> EMPTY_REGION_LIST = new ArrayList<HRegionInfo>(0);
+  private static final List<HRegionInfo> EMPTY_REGION_LIST = new ArrayList<>(0);
 
   static final Predicate<ServerLoad> IDLE_SERVER_PREDICATOR
     = load -> load.getNumberOfRegions() == 0;
@@ -187,19 +187,19 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         unassignedRegions = EMPTY_REGION_LIST;
       }
 
-      serversToIndex = new HashMap<String, Integer>();
-      hostsToIndex = new HashMap<String, Integer>();
-      racksToIndex = new HashMap<String, Integer>();
-      tablesToIndex = new HashMap<String, Integer>();
+      serversToIndex = new HashMap<>();
+      hostsToIndex = new HashMap<>();
+      racksToIndex = new HashMap<>();
+      tablesToIndex = new HashMap<>();
 
       //TODO: We should get the list of tables from master
-      tables = new ArrayList<String>();
+      tables = new ArrayList<>();
       this.rackManager = rackManager != null ? rackManager : new DefaultRackManager();
 
       numRegions = 0;
 
-      List<List<Integer>> serversPerHostList = new ArrayList<List<Integer>>();
-      List<List<Integer>> serversPerRackList = new ArrayList<List<Integer>>();
+      List<List<Integer>> serversPerHostList = new ArrayList<>();
+      List<List<Integer>> serversPerRackList = new ArrayList<>();
       this.clusterState = clusterState;
       this.regionFinder = regionFinder;
 
@@ -211,7 +211,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         }
         if (!hostsToIndex.containsKey(sn.getHostname())) {
           hostsToIndex.put(sn.getHostname(), numHosts++);
-          serversPerHostList.add(new ArrayList<Integer>(1));
+          serversPerHostList.add(new ArrayList<>(1));
         }
 
         int serverIndex = serversToIndex.get(sn.getHostAndPort());
@@ -221,7 +221,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         String rack = this.rackManager.getRack(sn);
         if (!racksToIndex.containsKey(rack)) {
           racksToIndex.put(rack, numRacks++);
-          serversPerRackList.add(new ArrayList<Integer>());
+          serversPerRackList.add(new ArrayList<>());
         }
         int rackIndex = racksToIndex.get(rack);
         serversPerRackList.get(rackIndex).add(serverIndex);
@@ -233,7 +233,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
       }
       numRegions += unassignedRegions.size();
 
-      regionsToIndex = new HashMap<HRegionInfo, Integer>(numRegions);
+      regionsToIndex = new HashMap<>(numRegions);
       servers = new ServerName[numServers];
       serversPerHost = new int[numHosts][];
       serversPerRack = new int[numRacks][];
@@ -1064,7 +1064,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
   public static final String TABLES_ON_MASTER =
     "hbase.balancer.tablesOnMaster";
 
-  protected final Set<String> tablesOnMaster = new HashSet<String>();
+  protected final Set<String> tablesOnMaster = new HashSet<>();
   protected MetricsBalancer metricsBalancer = null;
   protected ClusterStatus clusterStatus = null;
   protected ServerName masterServerName;
@@ -1170,7 +1170,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         // Move this region away from the master regionserver
         RegionPlan plan = new RegionPlan(region, masterServerName, dest);
         if (plans == null) {
-          plans = new ArrayList<RegionPlan>();
+          plans = new ArrayList<>();
         }
         plans.add(plan);
       }
@@ -1183,7 +1183,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         // Move this region to the master regionserver
         RegionPlan plan = new RegionPlan(region, server.getKey(), masterServerName);
         if (plans == null) {
-          plans = new ArrayList<RegionPlan>();
+          plans = new ArrayList<>();
         }
         plans.add(plan);
       }
@@ -1199,10 +1199,9 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     if (servers == null || regions == null || regions.isEmpty()) {
       return null;
     }
-    Map<ServerName, List<HRegionInfo>> assignments
-      = new TreeMap<ServerName, List<HRegionInfo>>();
+    Map<ServerName, List<HRegionInfo>> assignments = new TreeMap<>();
     if (masterServerName != null && servers.contains(masterServerName)) {
-      assignments.put(masterServerName, new ArrayList<HRegionInfo>());
+      assignments.put(masterServerName, new ArrayList<>());
       for (HRegionInfo region: regions) {
         if (shouldBeOnMaster(region)) {
           assignments.get(masterServerName).add(region);
@@ -1303,12 +1302,12 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     metricsBalancer.incrMiscInvocations();
     Map<ServerName, List<HRegionInfo>> assignments = assignMasterRegions(regions, servers);
     if (assignments != null && !assignments.isEmpty()) {
-      servers = new ArrayList<ServerName>(servers);
+      servers = new ArrayList<>(servers);
       // Guarantee not to put other regions on master
       servers.remove(masterServerName);
       List<HRegionInfo> masterRegions = assignments.get(masterServerName);
       if (!masterRegions.isEmpty()) {
-        regions = new ArrayList<HRegionInfo>(regions);
+        regions = new ArrayList<>(regions);
         for (HRegionInfo region: masterRegions) {
           regions.remove(region);
         }
@@ -1331,17 +1330,17 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
 
     if (numServers == 1) { // Only one server, nothing fancy we can do here
       ServerName server = servers.get(0);
-      assignments.put(server, new ArrayList<HRegionInfo>(regions));
+      assignments.put(server, new ArrayList<>(regions));
       return assignments;
     }
 
     Cluster cluster = createCluster(servers, regions, false);
-    List<HRegionInfo> unassignedRegions = new ArrayList<HRegionInfo>();
+    List<HRegionInfo> unassignedRegions = new ArrayList<>();
 
     roundRobinAssignment(cluster, regions, unassignedRegions,
       servers, assignments);
 
-    List<HRegionInfo> lastFewRegions = new ArrayList<HRegionInfo>();
+    List<HRegionInfo> lastFewRegions = new ArrayList<>();
     // assign the remaining by going through the list and try to assign to servers one-by-one
     int serverIdx = RANDOM.nextInt(numServers);
     for (HRegionInfo region : unassignedRegions) {
@@ -1351,7 +1350,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
         if (!cluster.wouldLowerAvailability(region, serverName)) {
           List<HRegionInfo> serverRegions = assignments.get(serverName);
           if (serverRegions == null) {
-            serverRegions = new ArrayList<HRegionInfo>();
+            serverRegions = new ArrayList<>();
             assignments.put(serverName, serverRegions);
           }
           serverRegions.add(region);
@@ -1372,7 +1371,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
       ServerName server = servers.get(i);
       List<HRegionInfo> serverRegions = assignments.get(server);
       if (serverRegions == null) {
-        serverRegions = new ArrayList<HRegionInfo>();
+        serverRegions = new ArrayList<>();
         assignments.put(server, serverRegions);
       }
       serverRegions.add(region);
@@ -1416,7 +1415,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
       if (shouldBeOnMaster(regionInfo)) {
         return masterServerName;
       }
-      servers = new ArrayList<ServerName>(servers);
+      servers = new ArrayList<>(servers);
       // Guarantee not to put other regions on master
       servers.remove(masterServerName);
     }
@@ -1465,12 +1464,12 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     Map<ServerName, List<HRegionInfo>> assignments
       = assignMasterRegions(regions.keySet(), servers);
     if (assignments != null && !assignments.isEmpty()) {
-      servers = new ArrayList<ServerName>(servers);
+      servers = new ArrayList<>(servers);
       // Guarantee not to put other regions on master
       servers.remove(masterServerName);
       List<HRegionInfo> masterRegions = assignments.get(masterServerName);
       if (!masterRegions.isEmpty()) {
-        regions = new HashMap<HRegionInfo, ServerName>(regions);
+        regions = new HashMap<>(regions);
         for (HRegionInfo region: masterRegions) {
           regions.remove(region);
         }
@@ -1487,7 +1486,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     }
     if (numServers == 1) { // Only one server, nothing fancy we can do here
       ServerName server = servers.get(0);
-      assignments.put(server, new ArrayList<HRegionInfo>(regions.keySet()));
+      assignments.put(server, new ArrayList<>(regions.keySet()));
       return assignments;
     }
 
@@ -1499,7 +1498,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     // servers on the same host on different ports.
     ArrayListMultimap<String, ServerName> serversByHostname = ArrayListMultimap.create();
     for (ServerName server : servers) {
-      assignments.put(server, new ArrayList<HRegionInfo>());
+      assignments.put(server, new ArrayList<>());
       serversByHostname.put(server.getHostname(), server);
     }
 
@@ -1516,7 +1515,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     for (Map.Entry<HRegionInfo, ServerName> entry : regions.entrySet()) {
       HRegionInfo region = entry.getKey();
       ServerName oldServerName = entry.getValue();
-      List<ServerName> localServers = new ArrayList<ServerName>();
+      List<ServerName> localServers = new ArrayList<>();
       if (oldServerName != null) {
         localServers = serversByHostname.get(oldServerName.getHostname());
       }
@@ -1629,7 +1628,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
 
     for (int j = 0; j < numServers; j++) {
       ServerName server = servers.get((j + serverIdx) % numServers);
-      List<HRegionInfo> serverRegions = new ArrayList<HRegionInfo>(max);
+      List<HRegionInfo> serverRegions = new ArrayList<>(max);
       for (int i = regionIdx; i < numRegions; i += numServers) {
         HRegionInfo region = regions.get(i % numRegions);
         if (cluster.wouldLowerAvailability(region, server)) {
@@ -1649,7 +1648,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     if (this.services != null && this.services.getAssignmentManager() != null) {
       return this.services.getAssignmentManager().getSnapShotOfAssignment(regions);
     } else {
-      return new HashMap<ServerName, List<HRegionInfo>>();
+      return new HashMap<>();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java
index e5f0e3b..8c337bd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java
@@ -39,7 +39,7 @@ public class ClusterLoadState {
     this.numRegions = 0;
     this.numServers = clusterState.size();
     this.clusterState = clusterState;
-    serversByLoad = new TreeMap<ServerAndLoad, List<HRegionInfo>>();
+    serversByLoad = new TreeMap<>();
     // Iterate so we can count regions as we build the map
     for (Map.Entry<ServerName, List<HRegionInfo>> server : clusterState.entrySet()) {
       List<HRegionInfo> regions = server.getValue();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.java
index d5edfab..f7e166d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.java
@@ -179,7 +179,7 @@ class RegionLocationFinder {
    */
   protected List<ServerName> getTopBlockLocations(HRegionInfo region, String currentHost) {
     HDFSBlocksDistribution blocksDistribution = getBlockDistribution(region);
-    List<String> topHosts = new ArrayList<String>();
+    List<String> topHosts = new ArrayList<>();
     for (String host : blocksDistribution.getTopHosts()) {
       if (host.equals(currentHost)) {
         break;
@@ -250,15 +250,15 @@ class RegionLocationFinder {
       return Lists.newArrayList();
     }
 
-    List<ServerName> topServerNames = new ArrayList<ServerName>();
+    List<ServerName> topServerNames = new ArrayList<>();
     Collection<ServerName> regionServers = status.getServers();
 
     // create a mapping from hostname to ServerName for fast lookup
-    HashMap<String, List<ServerName>> hostToServerName = new HashMap<String, List<ServerName>>();
+    HashMap<String, List<ServerName>> hostToServerName = new HashMap<>();
     for (ServerName sn : regionServers) {
       String host = sn.getHostname();
       if (!hostToServerName.containsKey(host)) {
-        hostToServerName.put(host, new ArrayList<ServerName>());
+        hostToServerName.put(host, new ArrayList<>());
       }
       hostToServerName.get(host).add(sn);
     }
@@ -309,8 +309,7 @@ class RegionLocationFinder {
   }
 
   public void refreshAndWait(Collection<HRegionInfo> hris) {
-    ArrayList<ListenableFuture<HDFSBlocksDistribution>> regionLocationFutures =
-        new ArrayList<ListenableFuture<HDFSBlocksDistribution>>(hris.size());
+    ArrayList<ListenableFuture<HDFSBlocksDistribution>> regionLocationFutures = new ArrayList<>(hris.size());
     for (HRegionInfo hregionInfo : hris) {
       regionLocationFutures.add(asyncGetBlockDistribution(hregionInfo));
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
index a6a0774..7e8d696 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/SimpleLoadBalancer.java
@@ -255,7 +255,7 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
       if (clusterMap.size() <= 2) {
         return null;
       }
-      clusterMap = new HashMap<ServerName, List<HRegionInfo>>(clusterMap);
+      clusterMap = new HashMap<>(clusterMap);
       clusterMap.remove(masterServerName);
     }
 
@@ -285,14 +285,13 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
     // TODO: Look at data block locality or a more complex load to do this
     MinMaxPriorityQueue<RegionPlan> regionsToMove =
       MinMaxPriorityQueue.orderedBy(rpComparator).create();
-    regionsToReturn = new ArrayList<RegionPlan>();
+    regionsToReturn = new ArrayList<>();
 
     // Walk down most loaded, pruning each to the max
     int serversOverloaded = 0;
     // flag used to fetch regions from head and tail of list, alternately
     boolean fetchFromTail = false;
-    Map<ServerName, BalanceInfo> serverBalanceInfo =
-      new TreeMap<ServerName, BalanceInfo>();
+    Map<ServerName, BalanceInfo> serverBalanceInfo = new TreeMap<>();
     for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
         serversByLoad.descendingMap().entrySet()) {
       ServerAndLoad sal = server.getKey();
@@ -330,7 +329,7 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
     int neededRegions = 0; // number of regions needed to bring all up to min
     fetchFromTail = false;
 
-    Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
+    Map<ServerName, Integer> underloadedServers = new HashMap<>();
     int maxToTake = numRegions - min;
     for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
         serversByLoad.entrySet()) {
@@ -524,8 +523,7 @@ public class SimpleLoadBalancer extends BaseLoadBalancer {
     // A structure help to map ServerName to  it's load and index in ServerLoadList
     Map<ServerName, Pair<ServerAndLoad,Integer>> SnLoadMap = new HashMap<>();
     for (int i = 0; i < serverLoadList.size(); i++) {
-      SnLoadMap.put(serverLoadList.get(i).getServerName(),
-              new Pair<ServerAndLoad, Integer>(serverLoadList.get(i), i));
+      SnLoadMap.put(serverLoadList.get(i).getServerName(), new Pair<>(serverLoadList.get(i), i));
     }
     Pair<ServerAndLoad,Integer> shredLoad;
     // A List to help mark the plan in regionsToMove that should be removed

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
index f2329bb..f68afb6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
@@ -121,7 +121,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
   private static final Random RANDOM = new Random(System.currentTimeMillis());
   private static final Log LOG = LogFactory.getLog(StochasticLoadBalancer.class);
 
-  Map<String, Deque<BalancerRegionLoad>> loads = new HashMap<String, Deque<BalancerRegionLoad>>();
+  Map<String, Deque<BalancerRegionLoad>> loads = new HashMap<>();
 
   // values are defaults
   private int maxSteps = 1000000;
@@ -332,7 +332,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
       if (clusterState.size() <= 2) {
         return null;
       }
-      clusterState = new HashMap<ServerName, List<HRegionInfo>>(clusterState);
+      clusterState = new HashMap<>(clusterState);
       clusterState.remove(masterServerName);
     }
 
@@ -482,7 +482,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
    * @return List of RegionPlan's that represent the moves needed to get to desired final state.
    */
   private List<RegionPlan> createRegionPlans(Cluster cluster) {
-    List<RegionPlan> plans = new LinkedList<RegionPlan>();
+    List<RegionPlan> plans = new LinkedList<>();
     for (int regionIndex = 0;
          regionIndex < cluster.regionIndexToServerIndex.length; regionIndex++) {
       int initialServerIndex = cluster.initialRegionIndexToServerIndex[regionIndex];
@@ -511,7 +511,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
     // We create a new hashmap so that regions that are no longer there are removed.
     // However we temporarily need the old loads so we can use them to keep the rolling average.
     Map<String, Deque<BalancerRegionLoad>> oldLoads = loads;
-    loads = new HashMap<String, Deque<BalancerRegionLoad>>();
+    loads = new HashMap<>();
 
     for (ServerName sn : clusterStatus.getServers()) {
       ServerLoad sl = clusterStatus.getLoad(sn);
@@ -522,7 +522,7 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
         Deque<BalancerRegionLoad> rLoads = oldLoads.get(Bytes.toString(entry.getKey()));
         if (rLoads == null) {
           // There was nothing there
-          rLoads = new ArrayDeque<BalancerRegionLoad>();
+          rLoads = new ArrayDeque<>();
         } else if (rLoads.size() >= numRegionLoadsToRemember) {
           rLoads.remove();
         }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
index c6b6f62..dddad36 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
@@ -92,7 +92,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Schedu
    * @param confKey key to get the file cleaner classes from the configuration
    */
   private void initCleanerChain(String confKey) {
-    this.cleanersChain = new LinkedList<T>();
+    this.cleanersChain = new LinkedList<>();
     String[] logCleaners = conf.getStrings(confKey);
     if (logCleaners != null) {
       for (String className : logCleaners) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.java
index 5c56271..45b2401 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationMetaCleaner.java
@@ -74,7 +74,7 @@ public class ReplicationMetaCleaner extends ScheduledChore {
           }
         }
         if (hasSerialScope) {
-          serialTables.put(entry.getValue().getTableName().getNameAsString(), new HashSet<String>());
+          serialTables.put(entry.getValue().getTableName().getNameAsString(), new HashSet<>());
         }
       }
       if (serialTables.isEmpty()){

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
index c0a1b75..dafc4f8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/ReplicationZKNodeCleaner.java
@@ -82,7 +82,7 @@ public class ReplicationZKNodeCleaner {
         for (String queueId : queueIds) {
           ReplicationQueueInfo queueInfo = new ReplicationQueueInfo(queueId);
           if (!peerIds.contains(queueInfo.getPeerId())) {
-            undeletedQueues.computeIfAbsent(replicator, (key) -> new ArrayList<String>()).add(
+            undeletedQueues.computeIfAbsent(replicator, (key) -> new ArrayList<>()).add(
               queueId);
             if (LOG.isDebugEnabled()) {
               LOG.debug("Undeleted replication queue for removed peer found: "

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/locking/LockProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/locking/LockProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/locking/LockProcedure.java
index c4b49f0..8e490eb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/locking/LockProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/locking/LockProcedure.java
@@ -477,4 +477,4 @@ public final class LockProcedure extends Procedure<MasterProcedureEnv>
       env.getProcedureScheduler().wakeRegions(LockProcedure.this, tableName, regionInfos);
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
index 5c67258..9c8358b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
@@ -118,7 +118,7 @@ public class SimpleRegionNormalizer implements RegionNormalizer {
       return null;
     }
 
-    List<NormalizationPlan> plans = new ArrayList<NormalizationPlan>();
+    List<NormalizationPlan> plans = new ArrayList<>();
     List<HRegionInfo> tableRegions = masterServices.getAssignmentManager().getRegionStates().
       getRegionsOfTable(table);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
index aefd14c..347d01d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java
@@ -70,8 +70,7 @@ public class CloneSnapshotProcedure
   private HTableDescriptor hTableDescriptor;
   private SnapshotDescription snapshot;
   private List<HRegionInfo> newRegions = null;
-  private Map<String, Pair<String, String> > parentsToChildrenPairMap =
-    new HashMap<String, Pair<String, String>>();
+  private Map<String, Pair<String, String> > parentsToChildrenPairMap = new HashMap<>();
 
   // Monitor
   private MonitoredTask monitorStatus = null;
@@ -264,18 +263,18 @@ public class CloneSnapshotProcedure
     if (cloneSnapshotMsg.getRegionInfoCount() == 0) {
       newRegions = null;
     } else {
-      newRegions = new ArrayList<HRegionInfo>(cloneSnapshotMsg.getRegionInfoCount());
+      newRegions = new ArrayList<>(cloneSnapshotMsg.getRegionInfoCount());
       for (HBaseProtos.RegionInfo hri: cloneSnapshotMsg.getRegionInfoList()) {
         newRegions.add(HRegionInfo.convert(hri));
       }
     }
     if (cloneSnapshotMsg.getParentToChildRegionsPairListCount() > 0) {
-      parentsToChildrenPairMap = new HashMap<String, Pair<String, String>>();
+      parentsToChildrenPairMap = new HashMap<>();
       for (MasterProcedureProtos.RestoreParentToChildRegionsPair parentToChildrenPair:
         cloneSnapshotMsg.getParentToChildRegionsPairListList()) {
         parentsToChildrenPairMap.put(
           parentToChildrenPair.getParentRegionName(),
-          new Pair<String, String>(
+          new Pair<>(
             parentToChildrenPair.getChild1RegionName(),
             parentToChildrenPair.getChild2RegionName()));
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java
index 2421dfc..ced7abc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java
@@ -208,7 +208,7 @@ public class CreateTableProcedure
     if (state.getRegionInfoCount() == 0) {
       newRegions = null;
     } else {
-      newRegions = new ArrayList<HRegionInfo>(state.getRegionInfoCount());
+      newRegions = new ArrayList<>(state.getRegionInfoCount());
       for (HBaseProtos.RegionInfo hri: state.getRegionInfoList()) {
         newRegions.add(HRegionInfo.convert(hri));
       }
@@ -364,8 +364,7 @@ public class CreateTableProcedure
     if (numRegionReplicas <= 0) {
       return regions;
     }
-    List<HRegionInfo> hRegionInfos =
-        new ArrayList<HRegionInfo>((numRegionReplicas+1)*regions.size());
+    List<HRegionInfo> hRegionInfos = new ArrayList<>((numRegionReplicas+1)*regions.size());
     for (int i = 0; i < regions.size(); i++) {
       for (int j = 1; j <= numRegionReplicas; j++) {
         hRegionInfos.add(RegionReplicaUtil.getRegionInfoForReplica(regions.get(i), j));

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java
index 06b666b..9d0a283 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java
@@ -221,7 +221,7 @@ public class DeleteTableProcedure
     if (state.getRegionInfoCount() == 0) {
       regions = null;
     } else {
-      regions = new ArrayList<HRegionInfo>(state.getRegionInfoCount());
+      regions = new ArrayList<>(state.getRegionInfoCount());
       for (HBaseProtos.RegionInfo hri: state.getRegionInfoList()) {
         regions.add(HRegionInfo.convert(hri));
       }
@@ -343,7 +343,7 @@ public class DeleteTableProcedure
     Scan tableScan = MetaTableAccessor.getScanForTableName(connection, tableName);
     try (Table metaTable =
         connection.getTable(TableName.META_TABLE_NAME)) {
-      List<Delete> deletes = new ArrayList<Delete>();
+      List<Delete> deletes = new ArrayList<>();
       try (ResultScanner resScanner = metaTable.getScanner(tableScan)) {
         for (Result result : resScanner) {
           deletes.add(new Delete(result.getRow()));

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java
index f4ecf15..4d67edd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java
@@ -357,7 +357,7 @@ public class EnableTableProcedure
 
     // need to potentially create some regions for the replicas
     List<HRegionInfo> unrecordedReplicas =
-        AssignmentManager.replicaRegionsNotRecordedInMeta(new HashSet<HRegionInfo>(
+        AssignmentManager.replicaRegionsNotRecordedInMeta(new HashSet<>(
             regionsToAssign.keySet()), masterServices);
     Map<ServerName, List<HRegionInfo>> srvToUnassignedRegs =
         assignmentManager.getBalancer().roundRobinAssignment(unrecordedReplicas,
@@ -464,8 +464,7 @@ public class EnableTableProcedure
   private static Map<HRegionInfo, ServerName> regionsToAssignWithServerName(
       final MasterProcedureEnv env,
       final List<Pair<HRegionInfo, ServerName>> regionsInMeta) throws IOException {
-    Map<HRegionInfo, ServerName> regionsToAssign =
-        new HashMap<HRegionInfo, ServerName>(regionsInMeta.size());
+    Map<HRegionInfo, ServerName> regionsToAssign = new HashMap<>(regionsInMeta.size());
     RegionStates regionStates = env.getMasterServices().getAssignmentManager().getRegionStates();
     for (Pair<HRegionInfo, ServerName> regionLocation : regionsInMeta) {
       HRegionInfo hri = regionLocation.getFirst();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterDDLOperationHelper.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterDDLOperationHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterDDLOperationHelper.java
index 980bf94..4b9a7ab 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterDDLOperationHelper.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterDDLOperationHelper.java
@@ -97,12 +97,12 @@ public final class MasterDDLOperationHelper {
       regionLocations = locator.getAllRegionLocations();
     }
     // Convert List<HRegionLocation> to Map<HRegionInfo, ServerName>.
-    NavigableMap<HRegionInfo, ServerName> hri2Sn = new TreeMap<HRegionInfo, ServerName>();
+    NavigableMap<HRegionInfo, ServerName> hri2Sn = new TreeMap<>();
     for (HRegionLocation location : regionLocations) {
       hri2Sn.put(location.getRegionInfo(), location.getServerName());
     }
     TreeMap<ServerName, List<HRegionInfo>> serverToRegions = Maps.newTreeMap();
-    List<HRegionInfo> reRegions = new ArrayList<HRegionInfo>();
+    List<HRegionInfo> reRegions = new ArrayList<>();
     for (HRegionInfo hri : regionInfoList) {
       ServerName sn = hri2Sn.get(hri);
       // Skip the offlined split parent region

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MergeTableRegionsProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MergeTableRegionsProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MergeTableRegionsProcedure.java
index d7fe5f6..366378a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MergeTableRegionsProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MergeTableRegionsProcedure.java
@@ -678,7 +678,7 @@ public class MergeTableRegionsProcedure
     final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
     if (cpHost != null) {
       @MetaMutationAnnotation
-      final List<Mutation> metaEntries = new ArrayList<Mutation>();
+      final List<Mutation> metaEntries = new ArrayList<>();
       boolean ret = cpHost.preMergeRegionsCommit(regionsToMerge, metaEntries, getUser());
 
       if (ret) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java
index f1b411a..6a70f62 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java
@@ -337,7 +337,7 @@ public class ModifyTableProcedure
     final int newReplicaCount = newHTableDescriptor.getRegionReplication();
 
     if (newReplicaCount < oldReplicaCount) {
-      Set<byte[]> tableRows = new HashSet<byte[]>();
+      Set<byte[]> tableRows = new HashSet<>();
       Connection connection = env.getMasterServices().getConnection();
       Scan scan = MetaTableAccessor.getScanForTableName(connection, getTableName());
       scan.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java
index d99bd6b..f8c9d8f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java
@@ -66,8 +66,7 @@ public class RestoreSnapshotProcedure
   private List<HRegionInfo> regionsToRestore = null;
   private List<HRegionInfo> regionsToRemove = null;
   private List<HRegionInfo> regionsToAdd = null;
-  private Map<String, Pair<String, String>> parentsToChildrenPairMap =
-    new HashMap<String, Pair<String, String>>();
+  private Map<String, Pair<String, String>> parentsToChildrenPairMap = new HashMap<>();
 
   private SnapshotDescription snapshot;
 
@@ -275,8 +274,7 @@ public class RestoreSnapshotProcedure
     if (restoreSnapshotMsg.getRegionInfoForRestoreCount() == 0) {
       regionsToRestore = null;
     } else {
-      regionsToRestore =
-        new ArrayList<HRegionInfo>(restoreSnapshotMsg.getRegionInfoForRestoreCount());
+      regionsToRestore = new ArrayList<>(restoreSnapshotMsg.getRegionInfoForRestoreCount());
       for (HBaseProtos.RegionInfo hri: restoreSnapshotMsg.getRegionInfoForRestoreList()) {
         regionsToRestore.add(HRegionInfo.convert(hri));
       }
@@ -284,8 +282,7 @@ public class RestoreSnapshotProcedure
     if (restoreSnapshotMsg.getRegionInfoForRemoveCount() == 0) {
       regionsToRemove = null;
     } else {
-      regionsToRemove =
-        new ArrayList<HRegionInfo>(restoreSnapshotMsg.getRegionInfoForRemoveCount());
+      regionsToRemove = new ArrayList<>(restoreSnapshotMsg.getRegionInfoForRemoveCount());
       for (HBaseProtos.RegionInfo hri: restoreSnapshotMsg.getRegionInfoForRemoveList()) {
         regionsToRemove.add(HRegionInfo.convert(hri));
       }
@@ -293,7 +290,7 @@ public class RestoreSnapshotProcedure
     if (restoreSnapshotMsg.getRegionInfoForAddCount() == 0) {
       regionsToAdd = null;
     } else {
-      regionsToAdd = new ArrayList<HRegionInfo>(restoreSnapshotMsg.getRegionInfoForAddCount());
+      regionsToAdd = new ArrayList<>(restoreSnapshotMsg.getRegionInfoForAddCount());
       for (HBaseProtos.RegionInfo hri: restoreSnapshotMsg.getRegionInfoForAddList()) {
         regionsToAdd.add(HRegionInfo.convert(hri));
       }
@@ -303,7 +300,7 @@ public class RestoreSnapshotProcedure
         restoreSnapshotMsg.getParentToChildRegionsPairListList()) {
         parentsToChildrenPairMap.put(
           parentToChildrenPair.getParentRegionName(),
-          new Pair<String, String>(
+          new Pair<>(
             parentToChildrenPair.getChild1RegionName(),
             parentToChildrenPair.getChild2RegionName()));
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
index 7b4eb6e..484decc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
@@ -99,7 +99,7 @@ implements ServerProcedureInterface {
 
   public static final int DEFAULT_WAIT_ON_RIT = 30000;
 
-  private static final Set<HRegionInfo> META_REGION_SET = new HashSet<HRegionInfo>();
+  private static final Set<HRegionInfo> META_REGION_SET = new HashSet<>();
   static {
     META_REGION_SET.add(HRegionInfo.FIRST_META_REGIONINFO);
   }
@@ -424,7 +424,7 @@ implements ServerProcedureInterface {
   private List<HRegionInfo> calcRegionsToAssign(final MasterProcedureEnv env)
   throws IOException {
     AssignmentManager am = env.getMasterServices().getAssignmentManager();
-    List<HRegionInfo> regionsToAssignAggregator = new ArrayList<HRegionInfo>();
+    List<HRegionInfo> regionsToAssignAggregator = new ArrayList<>();
     int replicaCount = env.getMasterConfiguration().getInt(HConstants.META_REPLICAS_NUM,
       HConstants.DEFAULT_META_REPLICA_NUM);
     for (int i = 1; i < replicaCount; i++) {
@@ -625,14 +625,14 @@ implements ServerProcedureInterface {
     this.shouldSplitWal = state.getShouldSplitWal();
     int size = state.getRegionsOnCrashedServerCount();
     if (size > 0) {
-      this.regionsOnCrashedServer = new HashSet<HRegionInfo>(size);
+      this.regionsOnCrashedServer = new HashSet<>(size);
       for (RegionInfo ri: state.getRegionsOnCrashedServerList()) {
         this.regionsOnCrashedServer.add(HRegionInfo.convert(ri));
       }
     }
     size = state.getRegionsAssignedCount();
     if (size > 0) {
-      this.regionsAssigned = new ArrayList<HRegionInfo>(size);
+      this.regionsAssigned = new ArrayList<>(size);
       for (RegionInfo ri: state.getRegionsOnCrashedServerList()) {
         this.regionsAssigned.add(HRegionInfo.convert(ri));
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitTableRegionProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitTableRegionProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitTableRegionProcedure.java
index 69b89be..3cd6c66 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitTableRegionProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/SplitTableRegionProcedure.java
@@ -547,7 +547,7 @@ public class SplitTableRegionProcedure
     }
     if (nbFiles == 0) {
       // no file needs to be splitted.
-      return new Pair<Integer, Integer>(0,0);
+      return new Pair<>(0,0);
     }
     // Default max #threads to use is the smaller of table's configured number of blocking store
     // files or the available number of logical cores.
@@ -561,7 +561,7 @@ public class SplitTableRegionProcedure
             " using " + maxThreads + " threads");
     ThreadPoolExecutor threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(
       maxThreads, Threads.getNamedThreadFactory("StoreFileSplitter-%1$d"));
-    List<Future<Pair<Path,Path>>> futures = new ArrayList<Future<Pair<Path,Path>>> (nbFiles);
+    List<Future<Pair<Path,Path>>> futures = new ArrayList<>(nbFiles);
 
     // Split each store file.
     final HTableDescriptor htd = env.getMasterServices().getTableDescriptors().get(getTableName());
@@ -617,7 +617,7 @@ public class SplitTableRegionProcedure
       LOG.debug("Split storefiles for region " + parentHRI + " Daughter A: " + daughterA
           + " storefiles, Daughter B: " + daughterB + " storefiles.");
     }
-    return new Pair<Integer, Integer>(daughterA, daughterB);
+    return new Pair<>(daughterA, daughterB);
   }
 
   private void assertReferenceFileCount(
@@ -646,7 +646,7 @@ public class SplitTableRegionProcedure
     if (LOG.isDebugEnabled()) {
       LOG.debug("Splitting complete for store file: " + sf.getPath() + " for region: " + parentHRI);
     }
-    return new Pair<Path,Path>(path_first, path_second);
+    return new Pair<>(path_first, path_second);
   }
 
   /**
@@ -684,7 +684,7 @@ public class SplitTableRegionProcedure
    **/
   private void preSplitRegionBeforePONR(final MasterProcedureEnv env)
     throws IOException, InterruptedException {
-    final List<Mutation> metaEntries = new ArrayList<Mutation>();
+    final List<Mutation> metaEntries = new ArrayList<>();
     final MasterCoprocessorHost cpHost = env.getMasterCoprocessorHost();
     if (cpHost != null) {
       if (cpHost.preSplitBeforePONRAction(getSplitRow(), metaEntries, getUser())) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java
index 7482831..2ab142a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java
@@ -250,7 +250,7 @@ public class TruncateTableProcedure
     if (state.getRegionInfoCount() == 0) {
       regions = null;
     } else {
-      regions = new ArrayList<HRegionInfo>(state.getRegionInfoCount());
+      regions = new ArrayList<>(state.getRegionInfoCount());
       for (HBaseProtos.RegionInfo hri: state.getRegionInfoList()) {
         regions.add(HRegionInfo.convert(hri));
       }
@@ -258,7 +258,7 @@ public class TruncateTableProcedure
   }
 
   private static List<HRegionInfo> recreateRegionInfo(final List<HRegionInfo> regions) {
-    ArrayList<HRegionInfo> newRegions = new ArrayList<HRegionInfo>(regions.size());
+    ArrayList<HRegionInfo> newRegions = new ArrayList<>(regions.size());
     for (HRegionInfo hri: regions) {
       newRegions.add(new HRegionInfo(hri.getTable(), hri.getStartKey(), hri.getEndKey()));
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/DisabledTableSnapshotHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/DisabledTableSnapshotHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/DisabledTableSnapshotHandler.java
index 113ce58..5f86e08 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/DisabledTableSnapshotHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/DisabledTableSnapshotHandler.java
@@ -74,7 +74,7 @@ public class DisabledTableSnapshotHandler extends TakeSnapshotHandler {
       // 1. get all the regions hosting this table.
 
       // extract each pair to separate lists
-      Set<HRegionInfo> regions = new HashSet<HRegionInfo>();
+      Set<HRegionInfo> regions = new HashSet<>();
       for (Pair<HRegionInfo, ServerName> p : regionsAndLocations) {
         // Don't include non-default regions
         HRegionInfo hri = p.getFirst();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/EnabledTableSnapshotHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/EnabledTableSnapshotHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/EnabledTableSnapshotHandler.java
index e63727a..73cd4d7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/EnabledTableSnapshotHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/EnabledTableSnapshotHandler.java
@@ -71,7 +71,7 @@ public class EnabledTableSnapshotHandler extends TakeSnapshotHandler {
   @Override
   protected void snapshotRegions(List<Pair<HRegionInfo, ServerName>> regions)
       throws HBaseSnapshotException, IOException {
-    Set<String> regionServers = new HashSet<String>(regions.size());
+    Set<String> regionServers = new HashSet<>(regions.size());
     for (Pair<HRegionInfo, ServerName> region : regions) {
       if (region != null && region.getFirst() != null && region.getSecond() != null) {
         HRegionInfo hri = region.getFirst();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
index f03344c..b6641de 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java
@@ -90,13 +90,12 @@ public class SnapshotFileCache implements Stoppable {
   private final FileSystem fs;
   private final SnapshotFileInspector fileInspector;
   private final Path snapshotDir;
-  private final Set<String> cache = new HashSet<String>();
+  private final Set<String> cache = new HashSet<>();
   /**
    * This is a helper map of information about the snapshot directories so we don't need to rescan
    * them if they haven't changed since the last time we looked.
    */
-  private final Map<String, SnapshotDirectoryInfo> snapshots =
-      new HashMap<String, SnapshotDirectoryInfo>();
+  private final Map<String, SnapshotDirectoryInfo> snapshots = new HashMap<>();
   private final Timer refreshTimer;
 
   private long lastModifiedTime = Long.MIN_VALUE;
@@ -229,7 +228,7 @@ public class SnapshotFileCache implements Stoppable {
 
     // 2.clear the cache
     this.cache.clear();
-    Map<String, SnapshotDirectoryInfo> known = new HashMap<String, SnapshotDirectoryInfo>();
+    Map<String, SnapshotDirectoryInfo> known = new HashMap<>();
 
     // 3. check each of the snapshot directories
     FileStatus[] snapshots = FSUtils.listStatus(fs, snapshotDir);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java
index b950079..54b68d3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java
@@ -147,8 +147,7 @@ public class SnapshotManager extends MasterProcedureManager implements Stoppable
   // The map is always accessed and modified under the object lock using synchronized.
   // snapshotTable() will insert an Handler in the table.
   // isSnapshotDone() will remove the handler requested if the operation is finished.
-  private Map<TableName, SnapshotSentinel> snapshotHandlers =
-      new HashMap<TableName, SnapshotSentinel>();
+  private Map<TableName, SnapshotSentinel> snapshotHandlers = new HashMap<>();
 
   // Restore map, with table name as key, procedure ID as value.
   // The map is always accessed and modified under the object lock using synchronized.
@@ -157,7 +156,7 @@ public class SnapshotManager extends MasterProcedureManager implements Stoppable
   // TODO: just as the Apache HBase 1.x implementation, this map would not survive master
   // restart/failover. This is just a stopgap implementation until implementation of taking
   // snapshot using Procedure-V2.
-  private Map<TableName, Long> restoreTableToProcIdMap = new HashMap<TableName, Long>();
+  private Map<TableName, Long> restoreTableToProcIdMap = new HashMap<>();
 
   private Path rootDir;
   private ExecutorService executorService;
@@ -168,7 +167,7 @@ public class SnapshotManager extends MasterProcedureManager implements Stoppable
    *    - create snapshot
    *    - SnapshotCleaner
    * */
-  private KeyLocker<String> locks = new KeyLocker<String>();
+  private KeyLocker<String> locks = new KeyLocker<>();
 
 
 
@@ -209,7 +208,7 @@ public class SnapshotManager extends MasterProcedureManager implements Stoppable
    * @throws IOException File system exception
    */
   private List<SnapshotDescription> getCompletedSnapshots(Path snapshotDir) throws IOException {
-    List<SnapshotDescription> snapshotDescs = new ArrayList<SnapshotDescription>();
+    List<SnapshotDescription> snapshotDescs = new ArrayList<>();
     // first create the snapshot root path and check to see if it exists
     FileSystem fs = master.getMasterFileSystem().getFileSystem();
     if (snapshotDir == null) snapshotDir = SnapshotDescriptionUtils.getSnapshotsDir(rootDir);
@@ -1032,11 +1031,11 @@ public class SnapshotManager extends MasterProcedureManager implements Stoppable
     boolean userDisabled = (enabled != null && enabled.trim().length() > 0 && !snapshotEnabled);
 
     // Extract cleaners from conf
-    Set<String> hfileCleaners = new HashSet<String>();
+    Set<String> hfileCleaners = new HashSet<>();
     String[] cleaners = conf.getStrings(HFileCleaner.MASTER_HFILE_CLEANER_PLUGINS);
     if (cleaners != null) Collections.addAll(hfileCleaners, cleaners);
 
-    Set<String> logCleaners = new HashSet<String>();
+    Set<String> logCleaners = new HashSet<>();
     cleaners = conf.getStrings(HConstants.HBASE_MASTER_LOGCLEANER_PLUGINS);
     if (cleaners != null) Collections.addAll(logCleaners, cleaners);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
index 992f28e..123758f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java
@@ -183,7 +183,7 @@ public abstract class TakeSnapshotHandler extends EventHandler implements Snapsh
       monitor.rethrowException();
 
       // extract each pair to separate lists
-      Set<String> serverNames = new HashSet<String>();
+      Set<String> serverNames = new HashSet<>();
       for (Pair<HRegionInfo, ServerName> p : regionsAndLocations) {
         if (p != null && p.getFirst() != null && p.getSecond() != null) {
           HRegionInfo hri = p.getFirst();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
index 697286c..56c0242 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
@@ -174,7 +174,7 @@ public class DefaultMobStoreCompactor extends DefaultCompactor {
     long bytesWrittenProgressForShippedCall = 0;
     // Since scanner.next() can return 'false' but still be delivering data,
     // we have to use a do/while loop.
-    List<Cell> cells = new ArrayList<Cell>();
+    List<Cell> cells = new ArrayList<>();
     // Limit to "hbase.hstore.compaction.kv.max" (default 10) to avoid OOME
     int closeCheckSizeLimit = HStore.getCloseCheckInterval();
     long lastMillis = 0;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreFlusher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreFlusher.java
index 3c6a071..2456a41 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreFlusher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreFlusher.java
@@ -98,7 +98,7 @@ public class DefaultMobStoreFlusher extends DefaultStoreFlusher {
   @Override
   public List<Path> flushSnapshot(MemStoreSnapshot snapshot, long cacheFlushId,
       MonitoredTask status, ThroughputController throughputController) throws IOException {
-    ArrayList<Path> result = new ArrayList<Path>();
+    ArrayList<Path> result = new ArrayList<>();
     long cellsCount = snapshot.getCellsCount();
     if (cellsCount == 0) return result; // don't flush if there are no entries
 
@@ -179,7 +179,7 @@ public class DefaultMobStoreFlusher extends DefaultStoreFlusher {
     byte[] fileName = Bytes.toBytes(mobFileWriter.getPath().getName());
     ScannerContext scannerContext =
         ScannerContext.newBuilder().setBatchLimit(compactionKVMax).build();
-    List<Cell> cells = new ArrayList<Cell>();
+    List<Cell> cells = new ArrayList<>();
     boolean hasMore;
     String flushName = ThroughputControlUtil.getNameForThrottling(store, "flush");
     boolean control = throughputController != null && !store.getRegionInfo().isSystemTable();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFile.java
index 8c760e6..cd4c079 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFile.java
@@ -55,7 +55,7 @@ public class MobFile {
    * @throws IOException
    */
   public StoreFileScanner getScanner() throws IOException {
-    List<StoreFile> sfs = new ArrayList<StoreFile>();
+    List<StoreFile> sfs = new ArrayList<>();
     sfs.add(sf);
     List<StoreFileScanner> sfScanners = StoreFileScanner.getScannersForStoreFiles(sfs, false, true,
         false, false, sf.getMaxMemstoreTS());
@@ -85,7 +85,7 @@ public class MobFile {
   public Cell readCell(Cell search, boolean cacheMobBlocks, long readPt) throws IOException {
     Cell result = null;
     StoreFileScanner scanner = null;
-    List<StoreFile> sfs = new ArrayList<StoreFile>();
+    List<StoreFile> sfs = new ArrayList<>();
     sfs.add(sf);
     try {
       List<StoreFileScanner> sfScanners = StoreFileScanner.getScannersForStoreFiles(sfs,

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCache.java
index fd62340..25328b1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobFileCache.java
@@ -102,7 +102,7 @@ public class MobFileCache {
     this.mobFileMaxCacheSize = conf.getInt(MobConstants.MOB_FILE_CACHE_SIZE_KEY,
         MobConstants.DEFAULT_MOB_FILE_CACHE_SIZE);
     isCacheEnabled = (mobFileMaxCacheSize > 0);
-    map = new ConcurrentHashMap<String, CachedMobFile>(mobFileMaxCacheSize);
+    map = new ConcurrentHashMap<>(mobFileMaxCacheSize);
     if (isCacheEnabled) {
       long period = conf.getLong(MobConstants.MOB_CACHE_EVICT_PERIOD,
           MobConstants.DEFAULT_MOB_CACHE_EVICT_PERIOD); // in seconds
@@ -136,12 +136,12 @@ public class MobFileCache {
         return;
       }
       printStatistics();
-      List<CachedMobFile> evictedFiles = new ArrayList<CachedMobFile>();
+      List<CachedMobFile> evictedFiles = new ArrayList<>();
       try {
         if (map.size() <= mobFileMaxCacheSize) {
           return;
         }
-        List<CachedMobFile> files = new ArrayList<CachedMobFile>(map.values());
+        List<CachedMobFile> files = new ArrayList<>(map.values());
         Collections.sort(files);
         int start = (int) (mobFileMaxCacheSize * evictRemainRatio);
         if (start >= 0) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java
index 8191828..eb75120 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/MobUtils.java
@@ -314,7 +314,7 @@ public final class MobUtils {
       // no file found
       return;
     }
-    List<StoreFile> filesToClean = new ArrayList<StoreFile>();
+    List<StoreFile> filesToClean = new ArrayList<>();
     int deletedFileCount = 0;
     for (FileStatus file : stats) {
       String fileName = file.getPath().getName();
@@ -482,7 +482,7 @@ public final class MobUtils {
   public static Cell createMobRefCell(Cell cell, byte[] fileName, Tag tableNameTag) {
     // Append the tags to the KeyValue.
     // The key is same, the value is the filename of the mob file
-    List<Tag> tags = new ArrayList<Tag>();
+    List<Tag> tags = new ArrayList<>();
     // Add the ref tag as the 1st one.
     tags.add(MobConstants.MOB_REF_TAG);
     // Add the tag of the source table name, this table is where this mob file is flushed
@@ -832,7 +832,7 @@ public final class MobUtils {
     if (maxThreads == 0) {
       maxThreads = 1;
     }
-    final SynchronousQueue<Runnable> queue = new SynchronousQueue<Runnable>();
+    final SynchronousQueue<Runnable> queue = new SynchronousQueue<>();
     ThreadPoolExecutor pool = new ThreadPoolExecutor(1, maxThreads, 60, TimeUnit.SECONDS, queue,
       Threads.newDaemonThreadFactory("MobCompactor"), new RejectedExecutionHandler() {
         @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/compactions/PartitionedMobCompactionRequest.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/compactions/PartitionedMobCompactionRequest.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/compactions/PartitionedMobCompactionRequest.java
index b6cf814..f1dcaee 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/compactions/PartitionedMobCompactionRequest.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mob/compactions/PartitionedMobCompactionRequest.java
@@ -71,7 +71,7 @@ public class PartitionedMobCompactionRequest extends MobCompactionRequest {
    * the same partition.
    */
   protected static class CompactionPartition {
-    private List<FileStatus> files = new ArrayList<FileStatus>();
+    private List<FileStatus> files = new ArrayList<>();
     private CompactionPartitionId partitionId;
 
     // The startKey and endKey of this partition, both are inclusive.

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredRPCHandlerImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredRPCHandlerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredRPCHandlerImpl.java
index 7ff7db6..b49df28 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredRPCHandlerImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredRPCHandlerImpl.java
@@ -224,7 +224,7 @@ public class MonitoredRPCHandlerImpl extends MonitoredTaskImpl
     if (getState() != State.RUNNING) {
       return map;
     }
-    Map<String, Object> rpcJSON = new HashMap<String, Object>();
+    Map<String, Object> rpcJSON = new HashMap<>();
     ArrayList paramList = new ArrayList();
     map.put("rpcCall", rpcJSON);
     rpcJSON.put("queuetimems", getRPCQueueTime());

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredTaskImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredTaskImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredTaskImpl.java
index 27aaceb..dda77ac 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredTaskImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/MonitoredTaskImpl.java
@@ -148,7 +148,7 @@ class MonitoredTaskImpl implements MonitoredTask {
 
   @Override
   public Map<String, Object> toMap() {
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     map.put("description", getDescription());
     map.put("status", getStatus());
     map.put("state", getState());

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
index 949b036..ff92704 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java
@@ -72,7 +72,7 @@ public class TaskMonitor {
     MonitoredTask proxy = (MonitoredTask) Proxy.newProxyInstance(
         stat.getClass().getClassLoader(),
         new Class<?>[] { MonitoredTask.class },
-        new PassthroughInvocationHandler<MonitoredTask>(stat));
+        new PassthroughInvocationHandler<>(stat));
     TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
     if (tasks.isFull()) {
       purgeExpiredTasks();
@@ -87,7 +87,7 @@ public class TaskMonitor {
     MonitoredRPCHandler proxy = (MonitoredRPCHandler) Proxy.newProxyInstance(
         stat.getClass().getClassLoader(),
         new Class<?>[] { MonitoredRPCHandler.class },
-        new PassthroughInvocationHandler<MonitoredRPCHandler>(stat));
+        new PassthroughInvocationHandler<>(stat));
     TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
     rpcTasks.add(pair);
     return proxy;
@@ -189,7 +189,7 @@ public class TaskMonitor {
     public TaskAndWeakRefPair(MonitoredTask stat,
         MonitoredTask proxy) {
       this.impl = stat;
-      this.weakProxy = new WeakReference<MonitoredTask>(proxy);
+      this.weakProxy = new WeakReference<>(proxy);
     }
     
     public MonitoredTask get() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
index 523b056..604f211 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
@@ -47,7 +47,7 @@ class NamespaceStateManager {
   private volatile boolean initialized = false;
 
   public NamespaceStateManager(MasterServices masterServices) {
-    nsStateCache = new ConcurrentHashMap<String, NamespaceTableAndRegionInfo>();
+    nsStateCache = new ConcurrentHashMap<>();
     master = masterServices;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceTableAndRegionInfo.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceTableAndRegionInfo.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceTableAndRegionInfo.java
index 86651e4..d30de6e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceTableAndRegionInfo.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceTableAndRegionInfo.java
@@ -40,7 +40,7 @@ class NamespaceTableAndRegionInfo {
 
   public NamespaceTableAndRegionInfo(String namespace) {
     this.name = namespace;
-    this.tableAndRegionInfo = new HashMap<TableName, AtomicInteger>();
+    this.tableAndRegionInfo = new HashMap<>();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManagerHost.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManagerHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManagerHost.java
index 8161ffe..222c933 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManagerHost.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/MasterProcedureManagerHost.java
@@ -33,8 +33,7 @@ import org.apache.zookeeper.KeeperException;
 public class MasterProcedureManagerHost extends
     ProcedureManagerHost<MasterProcedureManager> {
 
-  private Hashtable<String, MasterProcedureManager> procedureMgrMap
-      = new Hashtable<String, MasterProcedureManager>();
+  private Hashtable<String, MasterProcedureManager> procedureMgrMap = new Hashtable<>();
 
   @Override
   public void loadProcedures(Configuration conf) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java
index 0279a60..1d20ba5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/Procedure.java
@@ -125,9 +125,9 @@ public class Procedure implements Callable<Void>, ForeignExceptionListener {
   public Procedure(ProcedureCoordinator coord, ForeignExceptionDispatcher monitor, long wakeFreq,
       long timeout, String procName, byte[] args, List<String> expectedMembers) {
     this.coord = coord;
-    this.acquiringMembers = new ArrayList<String>(expectedMembers);
-    this.inBarrierMembers = new ArrayList<String>(acquiringMembers.size());
-    this.dataFromFinishedMembers = new HashMap<String, byte[]>();
+    this.acquiringMembers = new ArrayList<>(expectedMembers);
+    this.inBarrierMembers = new ArrayList<>(acquiringMembers.size());
+    this.dataFromFinishedMembers = new HashMap<>();
     this.procName = procName;
     this.args = args;
     this.monitor = monitor;

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java
index b7e0c04..8a64cc8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureCoordinator.java
@@ -113,7 +113,7 @@ public class ProcedureCoordinator {
   public static ThreadPoolExecutor defaultPool(String coordName, int opThreads,
       long keepAliveMillis) {
     return new ThreadPoolExecutor(1, opThreads, keepAliveMillis, TimeUnit.MILLISECONDS,
-        new SynchronousQueue<Runnable>(),
+        new SynchronousQueue<>(),
         new DaemonThreadFactory("(" + coordName + ")-proc-coordinator-pool"));
   }
 
@@ -325,6 +325,6 @@ public class ProcedureCoordinator {
    * @return Return set of all procedure names.
    */
   public Set<String> getProcedureNames() {
-    return new HashSet<String>(procedures.keySet());
+    return new HashSet<>(procedures.keySet());
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java
index 3ab4ac5..f61ce14 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureManagerHost.java
@@ -46,7 +46,7 @@ public abstract class ProcedureManagerHost<E extends ProcedureManager> {
 
   private static final Log LOG = LogFactory.getLog(ProcedureManagerHost.class);
 
-  protected Set<E> procedures = new HashSet<E>();
+  protected Set<E> procedures = new HashSet<>();
 
   /**
    * Load system procedures. Read the class names from configuration.
@@ -60,7 +60,7 @@ public abstract class ProcedureManagerHost<E extends ProcedureManager> {
     if (defaultProcClasses == null || defaultProcClasses.length == 0)
       return;
 
-    List<E> configured = new ArrayList<E>();
+    List<E> configured = new ArrayList<>();
     for (String className : defaultProcClasses) {
       className = className.trim();
       ClassLoader cl = this.getClass().getClassLoader();
@@ -105,7 +105,7 @@ public abstract class ProcedureManagerHost<E extends ProcedureManager> {
   }
 
   public Set<E> getProcedureManagers() {
-    Set<E> returnValue = new HashSet<E>();
+    Set<E> returnValue = new HashSet<>();
     for (E e: procedures) {
       returnValue.add(e);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java
index 485821e..baed1f3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/ProcedureMember.java
@@ -86,7 +86,7 @@ public class ProcedureMember implements Closeable {
   public static ThreadPoolExecutor defaultPool(String memberName, int procThreads,
       long keepAliveMillis) {
     return new ThreadPoolExecutor(1, procThreads, keepAliveMillis, TimeUnit.MILLISECONDS,
-        new SynchronousQueue<Runnable>(),
+        new SynchronousQueue<>(),
         new DaemonThreadFactory("member: '" + memberName + "' subprocedure-pool"));
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java
index 802a5ab..7b624a5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java
@@ -68,7 +68,7 @@ public class MasterFlushTableProcedureManager extends MasterProcedureManager {
 
   private MasterServices master;
   private ProcedureCoordinator coordinator;
-  private Map<TableName, Procedure> procMap = new HashMap<TableName, Procedure>();
+  private Map<TableName, Procedure> procMap = new HashMap<>();
   private boolean stopped;
 
   public MasterFlushTableProcedureManager() {};
@@ -135,7 +135,7 @@ public class MasterFlushTableProcedureManager extends MasterProcedureManager {
         master.getConnection(), tableName, false);
     }
 
-    Set<String> regionServers = new HashSet<String>(regionsAndLocations.size());
+    Set<String> regionServers = new HashSet<>(regionsAndLocations.size());
     for (Pair<HRegionInfo, ServerName> region : regionsAndLocations) {
       if (region != null && region.getFirst() != null && region.getSecond() != null) {
         HRegionInfo hri = region.getFirst();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
index 1aa959c..147c013 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/RegionServerFlushTableProcedureManager.java
@@ -201,7 +201,7 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur
     private final ExecutorCompletionService<Void> taskPool;
     private final ThreadPoolExecutor executor;
     private volatile boolean stopped;
-    private final List<Future<Void>> futures = new ArrayList<Future<Void>>();
+    private final List<Future<Void>> futures = new ArrayList<>();
     private final String name;
 
     FlushTableSubprocedurePool(String name, Configuration conf, Abortable abortable) {
@@ -213,10 +213,10 @@ public class RegionServerFlushTableProcedureManager extends RegionServerProcedur
       int threads = conf.getInt(CONCURENT_FLUSH_TASKS_KEY, DEFAULT_CONCURRENT_FLUSH_TASKS);
       this.name = name;
       executor = new ThreadPoolExecutor(threads, threads, keepAlive, TimeUnit.MILLISECONDS,
-          new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
+          new LinkedBlockingQueue<>(), new DaemonThreadFactory("rs("
               + name + ")-flush-proc-pool"));
       executor.allowCoreThreadTimeOut(true);
-      taskPool = new ExecutorCompletionService<Void>(executor);
+      taskPool = new ExecutorCompletionService<>(executor);
     }
 
     boolean hasTasks() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
index c301759..8f681f0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/protobuf/ReplicationProtbufUtil.java
@@ -99,7 +99,7 @@ public class ReplicationProtbufUtil {
       buildReplicateWALEntryRequest(final Entry[] entries, byte[] encodedRegionName,
           String replicationClusterId, Path sourceBaseNamespaceDir, Path sourceHFileArchiveDir) {
     // Accumulate all the Cells seen in here.
-    List<List<? extends Cell>> allCells = new ArrayList<List<? extends Cell>>(entries.length);
+    List<List<? extends Cell>> allCells = new ArrayList<>(entries.length);
     int size = 0;
     WALProtos.FamilyScope.Builder scopeBuilder = WALProtos.FamilyScope.newBuilder();
     AdminProtos.WALEntry.Builder entryBuilder = AdminProtos.WALEntry.newBuilder();
@@ -165,7 +165,7 @@ public class ReplicationProtbufUtil {
       builder.setSourceHFileArchiveDirPath(sourceHFileArchiveDir.toString());
     }
 
-    return new Pair<AdminProtos.ReplicateWALEntryRequest, CellScanner>(builder.build(),
+    return new Pair<>(builder.build(),
       getCellScanner(allCells, size));
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java
index 647a770..5dab2e3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java
@@ -80,9 +80,9 @@ public class MasterQuotaManager implements RegionStateListener {
     }
 
     LOG.info("Initializing quota support");
-    namespaceLocks = new NamedLock<String>();
-    tableLocks = new NamedLock<TableName>();
-    userLocks = new NamedLock<String>();
+    namespaceLocks = new NamedLock<>();
+    tableLocks = new NamedLock<>();
+    userLocks = new NamedLock<>();
 
     namespaceQuotaManager = new NamespaceAuditor(masterServices);
     namespaceQuotaManager.start();
@@ -460,7 +460,7 @@ public class MasterQuotaManager implements RegionStateListener {
   }
 
   private static class NamedLock<T> {
-    private HashSet<T> locks = new HashSet<T>();
+    private HashSet<T> locks = new HashSet<>();
 
     public void lock(final T name) throws InterruptedException {
       synchronized (locks) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
index 1451052..ad91617 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
@@ -65,12 +65,9 @@ public class QuotaCache implements Stoppable {
   // for testing purpose only, enforce the cache to be always refreshed
   static boolean TEST_FORCE_REFRESH = false;
 
-  private final ConcurrentHashMap<String, QuotaState> namespaceQuotaCache =
-      new ConcurrentHashMap<String, QuotaState>();
-  private final ConcurrentHashMap<TableName, QuotaState> tableQuotaCache =
-      new ConcurrentHashMap<TableName, QuotaState>();
-  private final ConcurrentHashMap<String, UserQuotaState> userQuotaCache =
-      new ConcurrentHashMap<String, UserQuotaState>();
+  private final ConcurrentHashMap<String, QuotaState> namespaceQuotaCache = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<TableName, QuotaState> tableQuotaCache = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<String, UserQuotaState> userQuotaCache = new ConcurrentHashMap<>();
   private final RegionServerServices rsServices;
 
   private QuotaRefresherChore refreshChore;
@@ -262,8 +259,8 @@ public class QuotaCache implements Stoppable {
       long evictPeriod = refreshPeriod * EVICT_PERIOD_FACTOR;
 
       // Find the quota entries to update
-      List<Get> gets = new ArrayList<Get>();
-      List<K> toRemove = new ArrayList<K>();
+      List<Get> gets = new ArrayList<>();
+      List<K> toRemove = new ArrayList<>();
       for (Map.Entry<K, V> entry: quotasMap.entrySet()) {
         long lastUpdate = entry.getValue().getLastUpdate();
         long lastQuery = entry.getValue().getLastQuery();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaUtil.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaUtil.java
index ab646b9..fd12fa1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaUtil.java
@@ -167,7 +167,7 @@ public class QuotaUtil extends QuotaTableUtil {
     long nowTs = EnvironmentEdgeManager.currentTime();
     Result[] results = doGet(connection, gets);
 
-    Map<String, UserQuotaState> userQuotas = new HashMap<String, UserQuotaState>(results.length);
+    Map<String, UserQuotaState> userQuotas = new HashMap<>(results.length);
     for (int i = 0; i < results.length; ++i) {
       byte[] key = gets.get(i).getRow();
       assert isUserRowKey(key);
@@ -232,7 +232,7 @@ public class QuotaUtil extends QuotaTableUtil {
     long nowTs = EnvironmentEdgeManager.currentTime();
     Result[] results = doGet(connection, gets);
 
-    Map<K, QuotaState> globalQuotas = new HashMap<K, QuotaState>(results.length);
+    Map<K, QuotaState> globalQuotas = new HashMap<>(results.length);
     for (int i = 0; i < results.length; ++i) {
       byte[] row = gets.get(i).getRow();
       K key = kfr.getKeyFromRow(row);

http://git-wip-us.apache.org/repos/asf/hbase/blob/b53f3547/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java
index cb00c34..21b4768 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/UserQuotaState.java
@@ -123,7 +123,7 @@ public class UserQuotaState extends QuotaState {
   private <K> Map<K, QuotaLimiter> setLimiter(Map<K, QuotaLimiter> limiters,
       final K key, final Quotas quotas) {
     if (limiters == null) {
-      limiters = new HashMap<K, QuotaLimiter>();
+      limiters = new HashMap<>();
     }
 
     QuotaLimiter limiter = quotas.hasThrottle() ?
@@ -164,7 +164,7 @@ public class UserQuotaState extends QuotaState {
 
     if (otherMap != null) {
       // To Remove
-      Set<K> toRemove = new HashSet<K>(map.keySet());
+      Set<K> toRemove = new HashSet<>(map.keySet());
       toRemove.removeAll(otherMap.keySet());
       map.keySet().removeAll(toRemove);
 


Mime
View raw message