accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [7/8] accumulo git commit: ACCUMULO-4642 Remove warning and unneeded objects
Date Mon, 12 Jun 2017 22:08:03 GMT
ACCUMULO-4642 Remove warning and unneeded objects

Remove deprecation warning for TabletBalancer init methods and
unnecessary creation of new instances of AccumuloServerContext.


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

Branch: refs/heads/master
Commit: 20ba43a17455d3b793edeb071d3792617b9acd89
Parents: f5371f9
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Mon Jun 12 15:27:14 2017 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Mon Jun 12 15:27:14 2017 -0400

----------------------------------------------------------------------
 .../accumulo/server/master/balancer/ChaoticLoadBalancer.java | 8 --------
 .../src/main/java/org/apache/accumulo/master/Master.java     | 2 +-
 .../apache/accumulo/master/MasterClientServiceHandler.java   | 7 ++-----
 3 files changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/20ba43a1/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 c93c4b9..ad03d85 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
@@ -31,8 +31,6 @@ import org.apache.accumulo.core.master.thrift.TableInfo;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
 import org.apache.accumulo.core.metadata.MetadataTable;
 import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
-import org.apache.accumulo.server.AccumuloServerContext;
-import org.apache.accumulo.server.conf.ServerConfigurationFactory;
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.master.state.TabletMigration;
 import org.apache.thrift.TException;
@@ -163,10 +161,4 @@ public class ChaoticLoadBalancer extends TabletBalancer {
     return 100;
   }
 
-  @Override
-  public void init(ServerConfigurationFactory conf) {}
-
-  @Override
-  public void init(AccumuloServerContext context) {}
-
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/20ba43a1/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index 51d0748..379b955 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -611,7 +611,7 @@ public class Master extends AccumuloServerContext implements LiveTServerSet.List
     ThriftTransportPool.getInstance().setIdleTime(aconf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT));
     tserverSet = new LiveTServerSet(this, this);
     this.tabletBalancer = aconf.instantiateClassProperty(Property.MASTER_TABLET_BALANCER,
TabletBalancer.class, new DefaultLoadBalancer());
-    this.tabletBalancer.init(new AccumuloServerContext(instance, serverConfig));
+    this.tabletBalancer.init(this);
 
     try {
       AccumuloVFSClassLoader.getContextManager().setContextConfig(new ContextManager.DefaultContextsConfig(new
Iterable<Entry<String,String>>() {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/20ba43a1/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
index 0f2e232..2497a44 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/MasterClientServiceHandler.java
@@ -78,7 +78,6 @@ import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter.Mutator;
 import org.apache.accumulo.master.tableOps.TraceRepo;
 import org.apache.accumulo.master.tserverOps.ShutdownTServer;
-import org.apache.accumulo.server.AccumuloServerContext;
 import org.apache.accumulo.server.client.ClientServiceHandler;
 import org.apache.accumulo.server.master.LiveTServerSet.TServerConnection;
 import org.apache.accumulo.server.master.balancer.DefaultLoadBalancer;
@@ -106,11 +105,9 @@ public class MasterClientServiceHandler extends FateServiceHandler implements
Ma
 
   private static final Logger log = Master.log;
   private static final Logger drainLog = LoggerFactory.getLogger("org.apache.accumulo.master.MasterDrainImpl");
-  private Instance instance;
 
   protected MasterClientServiceHandler(Master master) {
     super(master);
-    this.instance = master.getInstance();
   }
 
   @Override
@@ -260,7 +257,7 @@ public class MasterClientServiceHandler extends FateServiceHandler implements
Ma
   private String getNamespaceIdFromTableId(TableOperation tableOp, String tableId) throws
ThriftTableOperationException {
     String namespaceId;
     try {
-      namespaceId = Tables.getNamespaceId(instance, tableId);
+      namespaceId = Tables.getNamespaceId(master.getInstance(), tableId);
     } catch (TableNotFoundException e) {
       throw new ThriftTableOperationException(tableId, null, tableOp, TableOperationExceptionType.NOTFOUND,
e.getMessage());
     }
@@ -466,7 +463,7 @@ public class MasterClientServiceHandler extends FateServiceHandler implements
Ma
     if (property.equals(Property.MASTER_TABLET_BALANCER.getKey())) {
       TabletBalancer balancer = master.getConfiguration().instantiateClassProperty(Property.MASTER_TABLET_BALANCER,
TabletBalancer.class,
           new DefaultLoadBalancer());
-      balancer.init(new AccumuloServerContext(instance, master.getConfigurationFactory()));
+      balancer.init(master);
       master.tabletBalancer = balancer;
       log.info("tablet balancer changed to " + master.tabletBalancer.getClass().getName());
     }


Mime
View raw message