accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/6] git commit: Merge branch '1.6'
Date Sat, 25 Oct 2014 02:27:15 GMT
Merge branch '1.6'

Conflicts:
	server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
	server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
	server/master/src/main/java/org/apache/accumulo/master/Master.java
	server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
	server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java


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

Branch: refs/heads/master
Commit: 9a15f7b62aab997c6a934756ec7d7963e87134be
Parents: ebe6eec d2f82cd
Author: Josh Elser <elserj@apache.org>
Authored: Fri Oct 24 22:10:15 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Oct 24 22:10:15 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/server/Accumulo.java    | 66 ++++++++++++--------
 .../accumulo/server/fs/VolumeManagerImpl.java   | 11 +++-
 .../server/watcher/Log4jConfiguration.java      | 49 +++++++++++++++
 .../server/watcher/MonitorLog4jWatcher.java     | 25 +++-----
 .../accumulo/gc/SimpleGarbageCollector.java     |  8 ++-
 .../java/org/apache/accumulo/master/Master.java | 10 +--
 .../org/apache/accumulo/monitor/Monitor.java    | 21 ++++---
 .../org/apache/accumulo/tracer/TraceServer.java |  8 ++-
 .../apache/accumulo/tserver/TabletServer.java   |  8 ++-
 9 files changed, 139 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
index ac7ad60,0dc76b2..80dff9b
--- a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
@@@ -40,9 -40,10 +41,10 @@@ import org.apache.accumulo.fate.ReadOnl
  import org.apache.accumulo.fate.ReadOnlyTStore;
  import org.apache.accumulo.fate.ZooStore;
  import org.apache.accumulo.server.client.HdfsZooInstance;
 -import org.apache.accumulo.server.conf.ServerConfiguration;
 +import org.apache.accumulo.server.conf.ServerConfigurationFactory;
  import org.apache.accumulo.server.fs.VolumeManager;
  import org.apache.accumulo.server.util.time.SimpleTimer;
+ import org.apache.accumulo.server.watcher.Log4jConfiguration;
  import org.apache.accumulo.server.watcher.MonitorLog4jWatcher;
  import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
  import org.apache.hadoop.fs.FileStatus;
@@@ -166,8 -163,20 +164,20 @@@ public class Accumulo 
  
      DOMConfigurator.configureAndWatch(auditConfig, 5000);
  
-     // Configure logging using information advertised in zookeeper by the monitor
-     MonitorLog4jWatcher logConfigWatcher = new MonitorLog4jWatcher(config.getInstance().getInstanceID(),
logConfig);
+     // Set up local file-based logging right away
+     Log4jConfiguration logConf = new Log4jConfiguration(logConfigFile);
+     logConf.resetLogger();
+   }
+ 
 -  public static void init(VolumeManager fs, ServerConfiguration serverConfig, String application)
throws IOException {
++  public static void init(VolumeManager fs, ServerConfigurationFactory serverConfig, String
application) throws IOException {
+     final AccumuloConfiguration conf = serverConfig.getConfiguration();
+     final Instance instance = serverConfig.getInstance();
+ 
+     // Use a specific log config, if it exists
+     final String logConfigFile = locateLogConfig(System.getenv("ACCUMULO_CONF_DIR"), application);
+ 
+     // Set up polling log4j updates and log-forwarding using information advertised in zookeeper
by the monitor
+     MonitorLog4jWatcher logConfigWatcher = new MonitorLog4jWatcher(instance.getInstanceID(),
logConfigFile);
      logConfigWatcher.setDelay(5000L);
      logConfigWatcher.start();
  
@@@ -190,8 -203,8 +204,8 @@@
        String key = entry.getKey();
        log.info(key + " = " + (Property.isSensitive(key) ? "<hidden>" : entry.getValue()));
      }
-     
-     monitorSwappiness(config.getConfiguration());
+ 
 -    monitorSwappiness();
++    monitorSwappiness(conf);
    }
  
    /**
@@@ -206,14 -219,14 +220,14 @@@
     * Does the data version number stored in the backing Volumes indicate we need to upgrade
something?
     */
    public static boolean persistentVersionNeedsUpgrade(final int accumuloPersistentVersion)
{
 -    return accumuloPersistentVersion == ServerConstants.TWO_DATA_VERSIONS_AGO || accumuloPersistentVersion
== ServerConstants.PREV_DATA_VERSION;
 +    return ServerConstants.NEEDS_UPGRADE.get(accumuloPersistentVersion);
    }
-   
+ 
    /**
-    * 
+    *
     */
 -  public static void monitorSwappiness() {
 -    SimpleTimer.getInstance().schedule(new Runnable() {
 +  public static void monitorSwappiness(AccumuloConfiguration config) {
 +    SimpleTimer.getInstance(config).schedule(new Runnable() {
        @Override
        public void run() {
          try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/base/src/main/java/org/apache/accumulo/server/watcher/MonitorLog4jWatcher.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
diff --cc server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 84ad28b,9b4af58..ce6e9a7
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@@ -143,13 -136,15 +143,15 @@@ public class SimpleGarbageCollector imp
    private Instance instance;
  
    public static void main(String[] args) throws UnknownHostException, IOException {
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +    SecurityUtil.serverLogin(SiteConfiguration.getInstance());
+     final String app = "gc";
+     Accumulo.setupLogging(app);
      Instance instance = HdfsZooInstance.getInstance();
 -    ServerConfiguration conf = new ServerConfiguration(instance);
 +    ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
      final VolumeManager fs = VolumeManagerImpl.get();
-     Accumulo.init(fs, conf, "gc");
+     Accumulo.init(fs, conf, app);
      Opts opts = new Opts();
-     opts.parseArgs("gc", args);
+     opts.parseArgs(app, args);
      SimpleGarbageCollector gc = new SimpleGarbageCollector(opts);
      AccumuloConfiguration config = conf.getConfiguration();
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --cc server/master/src/main/java/org/apache/accumulo/master/Master.java
index 42495f4,52f116f..838ddb4
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@@ -1233,17 -1137,19 +1233,19 @@@ public class Master implements LiveTSer
  
    public static void main(String[] args) throws Exception {
      try {
 -      SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +      SecurityUtil.serverLogin(SiteConfiguration.getInstance());
  
-       VolumeManager fs = VolumeManagerImpl.get();
        ServerOpts opts = new ServerOpts();
-       opts.parseArgs("master", args);
+       final String app = "master";
+       opts.parseArgs(app, args);
        String hostname = opts.getAddress();
+       Accumulo.setupLogging(app);
        Instance instance = HdfsZooInstance.getInstance();
 -      ServerConfiguration conf = new ServerConfiguration(instance);
 +      ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
-       Accumulo.init(fs, conf, "master");
+       VolumeManager fs = VolumeManagerImpl.get();
+       Accumulo.init(fs, conf, app);
        Master master = new Master(conf, fs, hostname);
-       Accumulo.enableTracing(hostname, "master");
+       Accumulo.enableTracing(hostname, app);
        master.run();
      } catch (Exception ex) {
        log.error("Unexpected exception, exiting", ex);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
----------------------------------------------------------------------
diff --cc server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 7a724f8,c4ab6e6..6135fb0
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@@ -66,7 -62,7 +64,8 @@@ import org.apache.accumulo.monitor.serv
  import org.apache.accumulo.monitor.servlets.MasterServlet;
  import org.apache.accumulo.monitor.servlets.OperationServlet;
  import org.apache.accumulo.monitor.servlets.ProblemServlet;
 +import org.apache.accumulo.monitor.servlets.ReplicationServlet;
+ import org.apache.accumulo.monitor.servlets.ScanServlet;
  import org.apache.accumulo.monitor.servlets.ShellServlet;
  import org.apache.accumulo.monitor.servlets.TServersServlet;
  import org.apache.accumulo.monitor.servlets.TablesServlet;
@@@ -398,18 -396,20 +399,20 @@@ public class Monitor 
    }
  
    public static void main(String[] args) throws Exception {
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +    SecurityUtil.serverLogin(SiteConfiguration.getInstance());
-     
-     VolumeManager fs = VolumeManagerImpl.get();
+ 
      ServerOpts opts = new ServerOpts();
-     opts.parseArgs("monitor", args);
+     final String app = "monitor";
+     opts.parseArgs(app, args);
      String hostname = opts.getAddress();
  
+     Accumulo.setupLogging(app);
+     VolumeManager fs = VolumeManagerImpl.get();
      instance = HdfsZooInstance.getInstance();
 -    config = new ServerConfiguration(instance);
 +    config = new ServerConfigurationFactory(instance);
-     Accumulo.init(fs, config, "monitor");
+     Accumulo.init(fs, config, app);
      Monitor monitor = new Monitor();
-     Accumulo.enableTracing(hostname, "monitor");
+     Accumulo.enableTracing(hostname, app);
      monitor.run(hostname);
    }
  

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
----------------------------------------------------------------------
diff --cc server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
index 189bb39,e3ae0c8..e7e046e
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@@ -285,16 -283,18 +285,18 @@@ public class TraceServer implements Wat
    }
  
    public static void main(String[] args) throws Exception {
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +    SecurityUtil.serverLogin(SiteConfiguration.getInstance());
      ServerOpts opts = new ServerOpts();
-     opts.parseArgs("tracer", args);
+     final String app = "tracer";
+     opts.parseArgs(app, args);
+     Accumulo.setupLogging(app);
      Instance instance = HdfsZooInstance.getInstance();
 -    ServerConfiguration conf = new ServerConfiguration(instance);
 +    ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
      VolumeManager fs = VolumeManagerImpl.get();
-     Accumulo.init(fs, conf, "tracer");
+     Accumulo.init(fs, conf, app);
      String hostname = opts.getAddress();
      TraceServer server = new TraceServer(conf, hostname);
-     Accumulo.enableTracing(hostname, "tserver");
+     Accumulo.enableTracing(hostname, app);
      server.run();
      log.info("tracer stopping");
    }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/9a15f7b6/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 51e3d1a,23baf43..26c1759
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@@ -2864,13 -3660,15 +2864,15 @@@ public class TabletServer implements Ru
  
    public static void main(String[] args) throws IOException {
      try {
 -      SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +      SecurityUtil.serverLogin(SiteConfiguration.getInstance());
        ServerOpts opts = new ServerOpts();
        opts.parseArgs("tserver", args);
        String hostname = opts.getAddress();
-       Instance instance = HdfsZooInstance.getInstance();
+       final String app = "tserver";
+       Accumulo.setupLogging(app);
+       final Instance instance = HdfsZooInstance.getInstance();
 -      ServerConfiguration conf = new ServerConfiguration(instance);
 +      ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
+       VolumeManager fs = VolumeManagerImpl.get();
        Accumulo.init(fs, conf, "tserver");
        TabletServer server = new TabletServer(conf, fs);
        server.config(hostname);


Mime
View raw message