accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [6/9] accumulo git commit: ACCUMULO-4685 Fix minor type safety issues
Date Mon, 24 Jul 2017 21:26:41 GMT
ACCUMULO-4685 Fix minor type safety issues

Use diamond operator and generic method for emptySet


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0f061b99
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0f061b99
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0f061b99

Branch: refs/heads/master
Commit: 0f061b99cfae4fa9676ee5989eaf23682d1e61d9
Parents: 62d43cb
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon Jul 24 16:27:53 2017 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Jul 24 16:27:53 2017 -0400

----------------------------------------------------------------------
 .../server/master/balancer/HostRegexTableLoadBalancer.java       | 4 ++--
 .../server/master/balancer/HostRegexTableLoadBalancerTest.java   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0f061b99/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
index dbf03d0..72a3a23 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java
@@ -95,7 +95,7 @@ public class HostRegexTableLoadBalancer extends TableLoadBalancer implements
Con
   protected long oobCheckMillis = AccumuloConfiguration.getTimeInMillis(HOST_BALANCER_OOB_DEFAULT);
 
   private static final long ONE_HOUR = 60 * 60 * 1000;
-  private static final Set<KeyExtent> EMPTY_MIGRATIONS = Collections.EMPTY_SET;
+  private static final Set<KeyExtent> EMPTY_MIGRATIONS = Collections.emptySet();
 
   private Map<String,String> tableIdToTableName = null;
   private Map<String,Pattern> poolNameToRegexPattern = null;
@@ -411,7 +411,7 @@ public class HostRegexTableLoadBalancer extends TableLoadBalancer implements
Con
         LOG.trace("Sample up to 10 outstanding migrations: {}", Iterables.limit(migrations,
10));
       }
       migrationsFromLastPass.keySet().retainAll(migrations);
-      SortedMap<TServerInstance,TabletServerStatus> currentCopy = new TreeMap(current);
+      SortedMap<TServerInstance,TabletServerStatus> currentCopy = new TreeMap<>(current);
       Multimap<TServerInstance,String> serverTableIdCopied = HashMultimap.create();
       for (TabletMigration migration : migrationsFromLastPass.values()) {
         TableInfo fromInfo = getTableInfo(currentCopy, serverTableIdCopied, migration.tablet.getTableId().toString(),
migration.oldServer);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0f061b99/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerTest.java
b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerTest.java
index 120aab9..094ada8 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerTest.java
@@ -36,7 +36,6 @@ import org.apache.accumulo.core.data.thrift.TKeyExtent;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
 import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
 import org.apache.accumulo.fate.util.UtilWaitThread;
-import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.conf.TableConfiguration;
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.master.state.TabletMigration;
@@ -77,7 +76,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testBalance() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Set<KeyExtent> migrations = new HashSet<KeyExtent>();
     List<TabletMigration> migrationsOut = new ArrayList<TabletMigration>();
     long wait = this.balance(Collections.unmodifiableSortedMap(createCurrent(15)), migrations,
migrationsOut);


Mime
View raw message