accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [4/9] accumulo git commit: Merge branch '1.6' into 1.7
Date Fri, 26 Aug 2016 15:54:03 GMT
Merge branch '1.6' into 1.7

 Conflicts:
	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/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.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/371db68c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/371db68c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/371db68c

Branch: refs/heads/master
Commit: 371db68cfc4a82921a0b47c886be3e88c4058cdf
Parents: ffd5028 679a1c3
Author: Sean Busbey <busbey@cloudera.com>
Authored: Wed Aug 24 10:22:25 2016 -0500
Committer: Sean Busbey <busbey@cloudera.com>
Committed: Wed Aug 24 10:22:25 2016 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +-
 .../master/src/main/java/org/apache/accumulo/master/Master.java  | 4 ++--
 .../src/main/java/org/apache/accumulo/monitor/Monitor.java       | 4 ++--
 .../src/main/java/org/apache/accumulo/tracer/TraceServer.java    | 4 ++--
 .../src/main/java/org/apache/accumulo/tserver/TabletServer.java  | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/371db68c/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 da25d55,0191f38..98acf9a
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@@ -139,14 -133,16 +139,14 @@@ public class SimpleGarbageCollector ext
  
    private GCStatus status = new GCStatus(new GcCycleStats(), new GcCycleStats(), new GcCycleStats(),
new GcCycleStats());
  
 -  private Instance instance;
 -
    public static void main(String[] args) throws UnknownHostException, IOException {
-     SecurityUtil.serverLogin(SiteConfiguration.getInstance());
      final String app = "gc";
      Accumulo.setupLogging(app);
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
++    SecurityUtil.serverLogin(SiteConfiguration.getInstance());
      Instance instance = HdfsZooInstance.getInstance();
 +    ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
      log.info("Version " + Constants.VERSION);
      log.info("Instance " + instance.getInstanceID());
 -    ServerConfiguration conf = new ServerConfiguration(instance);
      final VolumeManager fs = VolumeManagerImpl.get();
      Accumulo.init(fs, conf, app);
      Opts opts = new Opts();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/371db68c/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 5a2a346,14bdd6b..dc26a11
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@@ -1345,14 -1156,15 +1345,14 @@@ public class Master extends AccumuloSer
  
    public static void main(String[] args) throws Exception {
      try {
+       final String app = "master";
+       Accumulo.setupLogging(app);
 -      SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +      SecurityUtil.serverLogin(SiteConfiguration.getInstance());
  
        ServerOpts opts = new ServerOpts();
-       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(HdfsZooInstance.getInstance());
        VolumeManager fs = VolumeManagerImpl.get();
        Accumulo.init(fs, conf, app);
        Master master = new Master(conf, fs, hostname);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/371db68c/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 c3dd773,e5ba9e4..58cf921
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@@ -417,18 -422,17 +417,18 @@@ public class Monitor 
    }
  
    public static void main(String[] args) throws Exception {
+     final String app = "monitor";
+     Accumulo.setupLogging(app);
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +    SecurityUtil.serverLogin(SiteConfiguration.getInstance());
  
      ServerOpts opts = new ServerOpts();
-     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);
 +    context = new AccumuloServerContext(config);
      log.info("Version " + Constants.VERSION);
      log.info("Instance " + instance.getInstanceID());
      Accumulo.init(fs, config, app);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/371db68c/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 2d5d68d,ebfed9c..4b07dcc
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/TraceServer.java
@@@ -305,41 -291,14 +305,41 @@@ public class TraceServer implements Wat
      zoo.exists(path, this);
    }
  
 +  private static void loginTracer(AccumuloConfiguration acuConf) {
 +    Map<String,String> loginMap = acuConf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
 +    String keyTab = loginMap.get(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey() + "keytab");
 +    if (keyTab == null || keyTab.length() == 0) {
 +      keyTab = acuConf.getPath(Property.GENERAL_KERBEROS_KEYTAB);
 +    }
 +    if (keyTab == null || keyTab.length() == 0)
 +      return;
 +
 +    String principalConfig = acuConf.get(Property.TRACE_USER);
 +    if (principalConfig == null || principalConfig.length() == 0)
 +      return;
 +
 +    log.info("Attempting to login as {} with {}", principalConfig, keyTab);
 +    if (SecurityUtil.login(principalConfig, keyTab)) {
 +      try {
 +        // This spawns a thread to periodically renew the logged in (trace) user
 +        UserGroupInformation.getLoginUser();
 +        return;
 +      } catch (IOException io) {
 +        log.error("Error starting up renewal thread. This shouldn't be happening.", io);
 +      }
 +    }
 +
 +    throw new RuntimeException("Failed to perform Kerberos login for " + principalConfig
+ " using  " + keyTab);
 +  }
 +
    public static void main(String[] args) throws Exception {
+     final String app = "tracer";
+     Accumulo.setupLogging(app);
 -    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +    loginTracer(SiteConfiguration.getInstance());
      ServerOpts opts = new ServerOpts();
-     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, app);
      String hostname = opts.getAddress();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/371db68c/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 a7abe05,2fdae29..6762c53
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@@ -2920,30 -3736,20 +2920,30 @@@ public class TabletServer extends Accum
  
    public static void main(String[] args) throws IOException {
      try {
+       final String app = "tserver";
+       Accumulo.setupLogging(app);
 -      SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
 +      SecurityUtil.serverLogin(SiteConfiguration.getInstance());
        ServerOpts opts = new ServerOpts();
-       final String app = "tserver";
        opts.parseArgs(app, args);
        String hostname = opts.getAddress();
-       Accumulo.setupLogging(app);
 -      final Instance instance = HdfsZooInstance.getInstance();
 -      ServerConfiguration conf = new ServerConfiguration(instance);
 +      ServerConfigurationFactory conf = new ServerConfigurationFactory(HdfsZooInstance.getInstance());
        VolumeManager fs = VolumeManagerImpl.get();
        Accumulo.init(fs, conf, app);
 -      TabletServer server = new TabletServer(conf, fs);
 +      final TabletServer server = new TabletServer(conf, fs);
        server.config(hostname);
 -      Accumulo.enableTracing(hostname, app);
 -      server.run();
 +      DistributedTrace.enable(hostname, app, conf.getConfiguration());
 +      if (UserGroupInformation.isSecurityEnabled()) {
 +        UserGroupInformation loginUser = UserGroupInformation.getLoginUser();
 +        loginUser.doAs(new PrivilegedExceptionAction<Void>() {
 +          @Override
 +          public Void run() {
 +            server.run();
 +            return null;
 +          }
 +        });
 +      } else {
 +        server.run();
 +      }
      } catch (Exception ex) {
        log.error("Uncaught exception in TabletServer.main, exiting", ex);
        System.exit(1);


Mime
View raw message