accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [40/50] git commit: ACCUMULO-1586 committing Michael Berman's patch
Date Tue, 23 Jul 2013 16:55:05 GMT
ACCUMULO-1586 committing Michael Berman's patch


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

Branch: refs/heads/ACCUMULO-1000
Commit: 1a48f7c34da98f4ba1fe3fac133081ee5f35caca
Parents: 8545123
Author: Eric Newton <ecn@apache.org>
Authored: Mon Jul 22 14:20:49 2013 -0400
Committer: Eric Newton <ecn@apache.org>
Committed: Mon Jul 22 14:20:49 2013 -0400

----------------------------------------------------------------------
 .../accumulo/server/metrics/AbstractMetricsImpl.java     |  1 -
 .../org/apache/accumulo/server/util/TServerUtils.java    | 11 ++++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/1a48f7c3/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
b/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
index a047507..9735371 100644
--- a/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
+++ b/server/src/main/java/org/apache/accumulo/server/metrics/AbstractMetricsImpl.java
@@ -138,7 +138,6 @@ public abstract class AbstractMetricsImpl {
     if (null == getObjectName())
       throw new IllegalArgumentException("MBean object name must be set.");
     mbs.registerMBean(this, getObjectName());
-    
     setupLogging();
   }
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/1a48f7c3/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java b/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
index be14023..0c751f5 100644
--- a/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
+++ b/server/src/main/java/org/apache/accumulo/server/util/TServerUtils.java
@@ -101,6 +101,8 @@ public class TServerUtils {
     boolean portSearch = false;
     if (portSearchProperty != null)
       portSearch = conf.getBoolean(portSearchProperty);
+    // create the TimedProcessor outside the port search loop so we don't try to register
the same metrics mbean more than once
+    TServerUtils.TimedProcessor timedProcessor = new TServerUtils.TimedProcessor(processor,
serverName, threadName);
     Random random = new Random();
     for (int j = 0; j < 100; j++) {
       
@@ -116,7 +118,7 @@ public class TServerUtils {
         if (port > 65535)
           port = 1024 + port % (65535 - 1024);
         try {
-          return TServerUtils.startTServer(port, processor, serverName, threadName, minThreads,
timeBetweenThreadChecks, maxMessageSize);
+          return TServerUtils.startTServer(port, timedProcessor, serverName, threadName,
minThreads, timeBetweenThreadChecks, maxMessageSize);
         } catch (Exception ex) {
           log.info("Unable to use port " + port + ", retrying. (Thread Name = " + threadName
+ ")");
           UtilWaitThread.sleep(250);
@@ -246,7 +248,6 @@ public class TServerUtils {
       }
     }, timeBetweenThreadChecks, timeBetweenThreadChecks);
     options.executorService(pool);
-    processor = new TServerUtils.TimedProcessor(processor, serverName, threadName);
     options.processorFactory(new TProcessorFactory(processor));
     return new ServerPort(new THsHaServer(options), port);
   }
@@ -268,13 +269,17 @@ public class TServerUtils {
     TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
     options.protocolFactory(ThriftUtil.protocolFactory());
     options.transportFactory(ThriftUtil.transportFactory());
-    processor = new TServerUtils.TimedProcessor(processor, serverName, threadName);
     options.processorFactory(new ClientInfoProcessorFactory(processor));
     return new ServerPort(new TThreadPoolServer(options), port);
   }
   
   public static ServerPort startTServer(int port, TProcessor processor, String serverName,
String threadName, int numThreads, long timeBetweenThreadChecks, long maxMessageSize)
       throws TTransportException {
+    return startTServer(port, new TimedProcessor(processor, serverName, threadName), serverName,
threadName, numThreads, timeBetweenThreadChecks, maxMessageSize);
+  }
+  
+  public static ServerPort startTServer(int port, TimedProcessor processor, String serverName,
String threadName, int numThreads, long timeBetweenThreadChecks, long maxMessageSize)
+      throws TTransportException {
     ServerPort result = startHsHaServer(port, processor, serverName, threadName, numThreads,
timeBetweenThreadChecks, maxMessageSize);
     // ServerPort result = startThreadPoolServer(port, processor, serverName, threadName,
-1);
     final TServer finalServer = result.server;


Mime
View raw message