accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [3/7] accumulo git commit: ACCUMULO-4549 Deprecate extra init in TabletBalancer
Date Wed, 11 Jan 2017 22:42:16 GMT
ACCUMULO-4549 Deprecate extra init in TabletBalancer


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

Branch: refs/heads/master
Commit: 1b2f40abc93481a48becbfbb946c6daf951082d0
Parents: c3d8703
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed Jan 11 17:22:41 2017 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed Jan 11 17:22:41 2017 -0500

----------------------------------------------------------------------
 .../master/balancer/ChaoticLoadBalancer.java    |  1 +
 .../server/master/balancer/TabletBalancer.java  |  4 ++++
 ...gexTableLoadBalancerReconfigurationTest.java |  5 ++---
 .../HostRegexTableLoadBalancerTest.java         | 21 ++++++++++----------
 4 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/1b2f40ab/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
index 112fcc1..995ccba 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancer.java
@@ -164,6 +164,7 @@ public class ChaoticLoadBalancer extends TabletBalancer {
     return 100;
   }
 
+  @Deprecated
   @Override
   public void init(ServerConfiguration conf) {
     throw new NotImplementedException();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/1b2f40ab/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
index a160bb0..b508433 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
@@ -59,6 +59,10 @@ public abstract class TabletBalancer {
     configuration = conf;
   }
 
+  /**
+   * @deprecated since 1.7.3 and 1.8.1; overriding this has no effect; subclasses should
override {@link #init(ServerConfigurationFactory)} instead.
+   */
+  @Deprecated
   public void init(ServerConfiguration conf) {
     init((ServerConfigurationFactory) conf);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/1b2f40ab/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
index 504b39b..05755b7 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancerReconfigurationTest.java
@@ -22,14 +22,13 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 
 import org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.data.impl.KeyExtent;
 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.master.state.TServerInstance;
 import org.apache.accumulo.server.master.state.TabletMigration;
 import org.apache.thrift.TException;
@@ -44,7 +43,7 @@ public class HostRegexTableLoadBalancerReconfigurationTest extends BaseHostRegex
   public void testConfigurationChanges() {
     DEFAULT_TABLE_PROPERTIES.put(HostRegexTableLoadBalancer.HOST_BALANCER_POOL_RECHECK_KEY,
"10s");
 
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<KeyExtent,TServerInstance> unassigned = new HashMap<>();
     for (List<KeyExtent> extents : tableExtents.values()) {
       for (KeyExtent ke : extents) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/1b2f40ab/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 c0ccc48..ed17508 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;
@@ -50,7 +49,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testInit() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Assert.assertEquals("OOB check interval value is incorrect", 10000, this.getOobCheckMillis());
     Assert.assertEquals("Pool check interval value is incorrect", 30000, this.getPoolRecheckMillis());
     Assert.assertFalse(isIpBasedRegex());
@@ -74,7 +73,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
   @Test
   public void testBalanceWithMigrations() {
     List<TabletMigration> migrations = new ArrayList<>();
-    init((ServerConfiguration) factory);
+    init(factory);
     long wait = this.balance(Collections.unmodifiableSortedMap(createCurrent(2)), Collections.singleton(new
KeyExtent()), migrations);
     Assert.assertEquals(5000, wait);
     Assert.assertEquals(0, migrations.size());
@@ -82,7 +81,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testSplitCurrentByRegexUsingHostname() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<String,SortedMap<TServerInstance,TabletServerStatus>> groups = this.splitCurrentByRegex(createCurrent(15));
     Assert.assertEquals(3, groups.size());
     Assert.assertTrue(groups.containsKey(FOO.getTableName()));
@@ -113,7 +112,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testSplitCurrentByRegexUsingOverlappingPools() {
-    init((ServerConfiguration) new TestServerConfigurationFactory(instance) {
+    init(new TestServerConfigurationFactory(instance) {
       @Override
       public TableConfiguration getTableConfiguration(String tableId) {
         return new TableConfiguration(getInstance(), tableId, null) {
@@ -176,7 +175,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testSplitCurrentByRegexUsingIP() {
-    init((ServerConfiguration) new TestServerConfigurationFactory(instance) {
+    init(new TestServerConfigurationFactory(instance) {
       @Override
       public synchronized AccumuloConfiguration getConfiguration() {
         HashMap<String,String> props = new HashMap<>();
@@ -242,7 +241,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testAllUnassigned() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<KeyExtent,TServerInstance> assignments = new HashMap<>();
     Map<KeyExtent,TServerInstance> unassigned = new HashMap<>();
     for (List<KeyExtent> extents : tableExtents.values()) {
@@ -273,7 +272,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testAllAssigned() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<KeyExtent,TServerInstance> assignments = new HashMap<>();
     Map<KeyExtent,TServerInstance> unassigned = new HashMap<>();
     this.getAssignments(Collections.unmodifiableSortedMap(allTabletServers), Collections.unmodifiableMap(unassigned),
assignments);
@@ -282,7 +281,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testPartiallyAssigned() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<KeyExtent,TServerInstance> assignments = new HashMap<>();
     Map<KeyExtent,TServerInstance> unassigned = new HashMap<>();
     int i = 0;
@@ -317,7 +316,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testUnassignedWithNoTServers() {
-    init((ServerConfiguration) factory);
+    init(factory);
     Map<KeyExtent,TServerInstance> assignments = new HashMap<>();
     Map<KeyExtent,TServerInstance> unassigned = new HashMap<>();
     for (KeyExtent ke : tableExtents.get(BAR.getTableName())) {
@@ -347,7 +346,7 @@ public class HostRegexTableLoadBalancerTest extends BaseHostRegexTableLoadBalanc
 
   @Test
   public void testOutOfBoundsTablets() {
-    init((ServerConfiguration) factory);
+    init(factory);
     // Wait to trigger the out of bounds check which will call our version of getOnlineTabletsForTable
     UtilWaitThread.sleep(11000);
     Set<KeyExtent> migrations = new HashSet<>();


Mime
View raw message