hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r916880 - in /hadoop/hbase/branches/0.20: ./ src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate...
Date Sat, 27 Feb 2010 00:23:19 GMT
Author: apurtell
Date: Sat Feb 27 00:23:19 2010
New Revision: 916880

URL: http://svn.apache.org/viewvc?rev=916880&view=rev
Log:
HBASE-2273 [stargate] export metrics via Hadoop metrics, JMX, and zookeeper

Added:
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Constants.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Main.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RootResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/TableResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/VersionResource.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
    hadoop/hbase/branches/0.20/src/contrib/stargate/src/test/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Sat Feb 27 00:23:19 2010
@@ -39,6 +39,7 @@
   NEW FEATURES
    HBASE-2257  [stargate] multiuser mode
    HBASE-2263  [stargate] multiuser mode: authenticator for zookeeper
+   HBASE-2273  [stargate] export metrics via Hadoop metrics, JMX, and zookeeper
 
 Release 0.20.3 - January 25th, 2010
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Constants.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Constants.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Constants.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Constants.java
Sat Feb 27 00:23:19 2010
@@ -28,6 +28,11 @@
 
   public static final String AUTHENTICATOR_KEY = "stargate.authenticator";
   public static final String MULTIUSER_KEY = "stargate.multiuser";
+  public static final String STATUS_REPORT_PERIOD_KEY =
+    "stargate.status.period";
+
+  public static final String INSTANCE_ZNODE_ROOT = "/stargate/instance";
+  public static final String USERS_ZNODE_ROOT = "/stargate/users";
 
   public static final int DEFAULT_MAX_AGE = 60 * 60 * 4;       // 4 hours
 

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Main.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Main.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Main.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/Main.java
Sat Feb 27 00:23:19 2010
@@ -24,6 +24,7 @@
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.PosixParser;
+import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.servlet.Context;
 import org.mortbay.jetty.servlet.ServletHolder;
@@ -54,11 +55,6 @@
       port = Integer.valueOf(cmd.getOptionValue("p"));
     }
 
-    // configure the Stargate singleton
-
-    RESTServlet servlet = RESTServlet.getInstance();
-    servlet.setMultiUser(cmd.hasOption("m"));
-
     // set up the Jersey servlet container for Jetty
 
     ServletHolder sh = new ServletHolder(ServletContainer.class);
@@ -77,6 +73,15 @@
       // set up context
     Context context = new Context(server, "/", Context.SESSIONS);
     context.addServlet(sh, "/*");
+
+    // configure the Stargate singleton
+
+    RESTServlet servlet = RESTServlet.getInstance();
+    servlet.setMultiUser(cmd.hasOption("m"));
+    for (Connector conn: server.getConnectors()) {
+      servlet.addConnectorAddress(conn.getHost(), conn.getLocalPort());
+    }
+
     server.start();
     server.join();
   }

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RESTServlet.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
Sat Feb 27 00:23:19 2010
@@ -21,37 +21,102 @@
 package org.apache.hadoop.hbase.stargate;
 
 import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
+import org.apache.hadoop.hbase.Chore;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.HTablePool;
 import org.apache.hadoop.hbase.stargate.auth.Authenticator;
 import org.apache.hadoop.hbase.stargate.auth.HBCAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.HTableAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.JDBCAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator;
+import org.apache.hadoop.hbase.stargate.metrics.StargateMetrics;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
+
 import org.apache.hadoop.util.StringUtils;
 
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.Watcher.Event.EventType;
+import org.apache.zookeeper.Watcher.Event.KeeperState;
+import org.apache.zookeeper.ZooDefs.Ids;
+import org.apache.zookeeper.data.Stat;
+
+import org.json.JSONStringer;
+
 import com.sun.jersey.server.impl.container.servlet.ServletAdaptor;
 
 /**
  * Singleton class encapsulating global REST servlet state and functions.
  */
-public class RESTServlet extends ServletAdaptor implements Constants {
+public class RESTServlet extends ServletAdaptor 
+    implements Constants, Watcher {
 
   private static final Log LOG = LogFactory.getLog(RESTServlet.class);
-  private static final long serialVersionUID = 1L;  
+  private static final long serialVersionUID = 1L;
+
   private static RESTServlet instance;
 
+  class StatusReporter extends Chore {
+
+    public StatusReporter(int period, AtomicBoolean stopping) {
+      super(period, stopping);
+    }
+
+    @Override
+    protected void chore() {
+      if (wrapper != null) try {
+        JSONStringer status = new JSONStringer();
+        status.object();
+        status.key("requests").value(metrics.getRequests());
+        status.key("connectors").array();
+        for (Pair<String,Integer> e: connectors) {
+          status.object()
+            .key("host").value(e.getFirst())
+            .key("port").value(e.getSecond())
+            .endObject();
+        }
+        status.endArray();
+        status.endObject();
+        updateNode(wrapper, znode, CreateMode.EPHEMERAL, 
+          Bytes.toBytes(status.toString()));
+      } catch (Exception e) {
+        LOG.error(StringUtils.stringifyException(e));
+      }
+    }
+
+  }
+
+  final String znode = INSTANCE_ZNODE_ROOT + "/" + System.currentTimeMillis();
   transient final HBaseConfiguration conf;
   transient final HTablePool pool;
+  transient volatile ZooKeeperWrapper wrapper;
+  transient Chore statusReporter;
+  transient Authenticator authenticator;
+  AtomicBoolean stopping = new AtomicBoolean(false);
+  boolean multiuser;
   Map<String,Integer> maxAgeMap = 
     Collections.synchronizedMap(new HashMap<String,Integer>());
-  boolean multiuser;
-  Authenticator authenticator;
+  List<Pair<String,Integer>> connectors = 
+    Collections.synchronizedList(new ArrayList<Pair<String,Integer>>());
+  StargateMetrics metrics = new StargateMetrics();
 
   /**
    * @return the RESTServlet singleton instance
@@ -64,6 +129,55 @@
     return instance;
   }
 
+  static boolean ensureExists(final ZooKeeperWrapper zkw, final String znode,
+      final CreateMode mode) throws IOException {
+    ZooKeeper zk = zkw.getZooKeeper();
+    try {
+      Stat stat = zk.exists(znode, false);
+      if (stat != null) {
+        return true;
+      }
+      zk.create(znode, new byte[0], Ids.OPEN_ACL_UNSAFE, mode);
+      LOG.debug("Created ZNode " + znode);
+      return true;
+    } catch (KeeperException.NodeExistsException e) {
+      return true;      // ok, move on.
+    } catch (KeeperException.NoNodeException e) {
+      return ensureParentExists(zkw, znode, mode) && 
+        ensureExists(zkw, znode, mode);
+    } catch (KeeperException e) {
+      throw new IOException(e);
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    }
+  }
+
+  static boolean ensureParentExists(final ZooKeeperWrapper zkw,
+      final String znode, final CreateMode mode) throws IOException {
+    int index = znode.lastIndexOf("/");
+    if (index <= 0) {   // Parent is root, which always exists.
+      return true;
+    }
+    return ensureExists(zkw, znode.substring(0, index), mode);
+  }
+
+  static void updateNode(final ZooKeeperWrapper zkw, final String znode, 
+        final CreateMode mode, final byte[] data) throws IOException  {
+    ensureExists(zkw, znode, mode);
+    ZooKeeper zk = zkw.getZooKeeper();
+    try {
+      zk.setData(znode, data, -1);
+    } catch (KeeperException e) {
+      throw new IOException(e);
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    }
+  }
+
+  ZooKeeperWrapper initZooKeeperWrapper() throws IOException {
+    return new ZooKeeperWrapper(conf, this);
+  }
+
   /**
    * Constructor
    * @throws IOException
@@ -71,23 +185,54 @@
   public RESTServlet() throws IOException {
     this.conf = new HBaseConfiguration();
     this.pool = new HTablePool(conf, 10);
+    this.wrapper = initZooKeeperWrapper();
+    this.statusReporter = new StatusReporter(
+      conf.getInt(STATUS_REPORT_PERIOD_KEY, 1000 * 60), stopping);
   }
 
-  /**
-   * Get a table pool for the given table. 
-   * @return the table pool
-   */
-  protected HTablePool getTablePool() {
+  @Override
+  public void process(WatchedEvent event) {
+    LOG.debug(("ZooKeeper.Watcher event " + event.getType() + " with path " +
+      event.getPath()));
+    // handle disconnection (or manual delete to test disconnection scenario)
+    if (event.getState() == KeeperState.Expired || 
+        (event.getType().equals(EventType.NodeDeleted) && 
+            event.getPath().equals(znode))) {
+      wrapper.close();
+      wrapper = null;
+      while (!stopping.get()) try {
+        wrapper = initZooKeeperWrapper();
+        break;
+      } catch (IOException e) {
+        LOG.error(StringUtils.stringifyException(e));
+        try {
+          Thread.sleep(10 * 1000);
+        } catch (InterruptedException ex) {
+        }
+      }
+    }
+  }
+
+  HTablePool getTablePool() {
     return pool;
   }
 
-  /**
-   * @return the servlet's global HBase configuration
-   */
-  protected HBaseConfiguration getConfiguration() {
+  ZooKeeperWrapper getZooKeeperWrapper() {
+    return wrapper;
+  }
+
+  HBaseConfiguration getConfiguration() {
     return conf;
   }
 
+  StargateMetrics getMetrics() {
+    return metrics;
+  }
+
+  void addConnectorAddress(String host, int port) {
+    connectors.add(new Pair<String,Integer>(host, port));
+  }
+
   /**
    * @param tableName the table name
    * @return the maximum cache age suitable for use with this table, in
@@ -147,10 +292,24 @@
    */
   public Authenticator getAuthenticator() {
     if (authenticator == null) {
-      String className = conf.get("stargate.auth.authenticator");
-      if (className != null) try {
+      String className = conf.get(AUTHENTICATOR_KEY,
+        HBCAuthenticator.class.getCanonicalName());
+      try {
         Class<?> c = getClass().getClassLoader().loadClass(className);
-        authenticator = (Authenticator)c.newInstance();
+        if (className.endsWith(HBCAuthenticator.class.getName()) ||
+            className.endsWith(HTableAuthenticator.class.getName()) ||
+            className.endsWith(JDBCAuthenticator.class.getName())) {
+          Constructor<?> cons = c.getConstructor(HBaseConfiguration.class);
+          authenticator = (Authenticator)
+            cons.newInstance(new Object[] { conf });
+        } else if (className.endsWith(ZooKeeperAuthenticator.class.getName())) {
+          Constructor<?> cons = c.getConstructor(HBaseConfiguration.class,
+            ZooKeeperWrapper.class);
+          authenticator = (Authenticator)
+            cons.newInstance(new Object[] { conf, wrapper });
+        } else {
+          authenticator = (Authenticator)c.newInstance();
+        }
       } catch (Exception e) {
         LOG.error(StringUtils.stringifyException(e));
       }

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RegionsResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
Sat Feb 27 00:23:19 2010
@@ -83,6 +83,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       TableInfoModel model = new TableInfoModel(table);
       Map<HRegionInfo,HServerAddress> regions = getTableRegions();

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RootResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RootResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RootResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RootResource.java
Sat Feb 27 00:23:19 2010
@@ -91,6 +91,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     if (servlet.isMultiUser()) {
       throw new WebApplicationException(Response.Status.BAD_REQUEST);
     }
@@ -114,7 +115,7 @@
   }
 
   @Path("version")
-  public VersionResource getVersionResource() {
+  public VersionResource getVersionResource() throws IOException {
     return new VersionResource();
   }
 

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
Sat Feb 27 00:23:19 2010
@@ -87,6 +87,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       ResultGenerator generator =
         ResultGenerator.fromRowSpec(actualTableName, rowspec);
@@ -124,6 +125,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath() + " as "+ MIMETYPE_BINARY);
     }
+    servlet.getMetrics().incrementRequests(1);
     // doesn't make sense to use a non specific coordinate as this can only
     // return a single cell
     if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) {
@@ -146,7 +148,8 @@
     }
   }
 
-  private Response update(CellSetModel model, boolean replace) {
+  Response update(CellSetModel model, boolean replace) {
+    servlet.getMetrics().incrementRequests(1);
     HTablePool pool = servlet.getTablePool();
     HTable table = null;
     try {
@@ -176,8 +179,9 @@
     }
   }
 
-  private Response updateBinary(byte[] message, HttpHeaders headers, 
+  Response updateBinary(byte[] message, HttpHeaders headers, 
       boolean replace) {
+    servlet.getMetrics().incrementRequests(1);
     HTablePool pool = servlet.getTablePool();
     HTable table = null;    
     try {
@@ -268,7 +272,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("DELETE " + uriInfo.getAbsolutePath());
     }
-
+    servlet.getMetrics().incrementRequests(1);
     Delete delete = null;
     if (rowspec.hasTimestamp())
       delete = new Delete(rowspec.getRow(), rowspec.getTimestamp(), null);

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
Sat Feb 27 00:23:19 2010
@@ -47,16 +47,18 @@
   private static final Log LOG =
     LogFactory.getLog(ScannerInstanceResource.class);
 
-  protected ResultGenerator generator;
-  private String id;
-  private int batch;
-  private CacheControl cacheControl;
+  ResultGenerator generator;
+  String id;
+  int batch;
+  RESTServlet servlet;
+  CacheControl cacheControl;
 
   public ScannerInstanceResource(String table, String id, 
       ResultGenerator generator, int batch) throws IOException {
     this.id = id;
     this.generator = generator;
     this.batch = batch;
+    servlet = RESTServlet.getInstance();
     cacheControl = new CacheControl();
     cacheControl.setNoCache(true);
     cacheControl.setNoTransform(false);
@@ -68,6 +70,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     CellSetModel model = new CellSetModel();
     RowModel rowModel = null;
     byte[] rowKey = null;
@@ -115,6 +118,7 @@
       LOG.debug("GET " + uriInfo.getAbsolutePath() + " as " +
         MIMETYPE_BINARY);
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       KeyValue value = generator.next();
       if (value == null) {
@@ -138,6 +142,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("DELETE " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     ScannerResource.delete(id);
     return Response.ok().build();
   }

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
Sat Feb 27 00:23:19 2010
@@ -54,8 +54,9 @@
   User user;
   String tableName;
   String actualTableName;
+  RESTServlet servlet;
 
-  public ScannerResource(User user, String table) {
+  public ScannerResource(User user, String table) throws IOException {
     if (user != null) {
       this.user = user;
       this.actualTableName = 
@@ -64,14 +65,24 @@
       this.actualTableName = table;
     }
     this.tableName = table;
+    servlet = RESTServlet.getInstance();
   }
 
-  private Response update(ScannerModel model, boolean replace,
-      UriInfo uriInfo) {
+  static void delete(String id) {
+    synchronized (scanners) {
+      ScannerInstanceResource instance = scanners.remove(id);
+      if (instance != null) {
+        instance.generator.close();
+      }
+    }
+  }
+
+  Response update(ScannerModel model, boolean replace, UriInfo uriInfo) {
+    servlet.getMetrics().incrementRequests(1);
+    byte[] endRow = model.hasEndRow() ? model.getEndRow() : null;
+    RowSpec spec = new RowSpec(model.getStartRow(), endRow,
+      model.getColumns(), model.getStartTime(), model.getEndTime(), 1);
     try {
-      byte[] endRow = model.hasEndRow() ? model.getEndRow() : null;
-      RowSpec spec = new RowSpec(model.getStartRow(), endRow,
-        model.getColumns(), model.getStartTime(), model.getEndTime(), 1);
       ScannerResultGenerator gen = new ScannerResultGenerator(actualTableName, spec);
       String id = gen.getID();
       ScannerInstanceResource instance = 
@@ -123,12 +134,4 @@
     }
   }
 
-  static void delete(String id) {
-    synchronized (scanners) {
-      ScannerInstanceResource instance = scanners.remove(id);
-      if (instance != null) {
-        instance.generator.close();
-      }
-    }
-  }
 }

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/SchemaResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
Sat Feb 27 00:23:19 2010
@@ -70,10 +70,10 @@
       this.actualTableName = table;
     }
     this.tableName = table;
+    servlet = RESTServlet.getInstance();
     cacheControl = new CacheControl();
     cacheControl.setNoCache(true);
     cacheControl.setNoTransform(false);
-    servlet = RESTServlet.getInstance();
   }
 
   private HTableDescriptor getTableSchema() throws IOException,
@@ -93,6 +93,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       HTableDescriptor htd = getTableSchema();
       TableSchemaModel model = new TableSchemaModel();
@@ -207,6 +208,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("PUT " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     // use the name given in the path, but warn if the name on the path and
     // the name in the schema are different
     if (model.getName() != tableName) {
@@ -222,6 +224,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("PUT " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     // use the name given in the path, but warn if the name on the path and
     // the name in the schema are different
     if (model.getName() != tableName) {
@@ -236,6 +239,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("DELETE " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
       admin.disableTable(actualTableName);

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
Sat Feb 27 00:23:19 2010
@@ -48,10 +48,10 @@
   private RESTServlet servlet;
 
   public StorageClusterStatusResource() throws IOException {
+    servlet = RESTServlet.getInstance();
     cacheControl = new CacheControl();
     cacheControl.setNoCache(true);
     cacheControl.setNoTransform(false);
-    servlet = RESTServlet.getInstance();
   }
 
   @GET
@@ -60,6 +60,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     try {
       HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
       ClusterStatus status = admin.getClusterStatus();

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
Sat Feb 27 00:23:19 2010
@@ -42,8 +42,10 @@
     LogFactory.getLog(StorageClusterVersionResource.class);
 
   private CacheControl cacheControl;
+  private RESTServlet servlet;
 
-  public StorageClusterVersionResource() {
+  public StorageClusterVersionResource() throws IOException {
+    servlet = RESTServlet.getInstance();
     cacheControl = new CacheControl();
     cacheControl.setNoCache(true);
     cacheControl.setNoTransform(false);
@@ -55,10 +57,10 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
+    HBaseConfiguration conf = servlet.getConfiguration();
     try {
-      RESTServlet server = RESTServlet.getInstance();
-      HBaseConfiguration hconf = server.getConfiguration();
-      HBaseAdmin admin = new HBaseAdmin(hconf);
+      HBaseAdmin admin = new HBaseAdmin(conf);
       StorageClusterVersionModel model = new StorageClusterVersionModel();
       model.setVersion(admin.getClusterStatus().getHBaseVersion());
       ResponseBuilder response = Response.ok(model);

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/TableResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/TableResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/TableResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/TableResource.java
Sat Feb 27 00:23:19 2010
@@ -46,7 +46,7 @@
   }
 
   @Path("scanner")
-  public ScannerResource getScannerResource() {
+  public ScannerResource getScannerResource() throws IOException {
     return new ScannerResource(user, table);
   }
 

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/VersionResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/VersionResource.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/VersionResource.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/VersionResource.java
Sat Feb 27 00:23:19 2010
@@ -20,6 +20,8 @@
 
 package org.apache.hadoop.hbase.stargate;
 
+import java.io.IOException;
+
 import javax.servlet.ServletContext;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -45,8 +47,10 @@
   private static final Log LOG = LogFactory.getLog(VersionResource.class);
 
   private CacheControl cacheControl;
+  private RESTServlet servlet;
 
-  public VersionResource() {
+  public VersionResource() throws IOException {
+    servlet = RESTServlet.getInstance();
     cacheControl = new CacheControl();
     cacheControl.setNoCache(true);
     cacheControl.setNoTransform(false);
@@ -65,6 +69,7 @@
     if (LOG.isDebugEnabled()) {
       LOG.debug("GET " + uriInfo.getAbsolutePath());
     }
+    servlet.getMetrics().incrementRequests(1);
     ResponseBuilder response = Response.ok(new VersionModel(context));
     response.cacheControl(cacheControl);
     return response.build();
@@ -74,7 +79,8 @@
    * Dispatch to StorageClusterVersionResource
    */
   @Path("cluster")
-  public StorageClusterVersionResource getClusterVersionResource() {
+  public StorageClusterVersionResource getClusterVersionResource() 
+      throws IOException {
     return new StorageClusterVersionResource();
   }
 

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
Sat Feb 27 00:23:19 2010
@@ -7,6 +7,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.util.StringUtils;
 import org.mortbay.log.Log;
 
@@ -24,12 +25,13 @@
 
   /**
    * Constructor
-   * @param url
-   * @param user
-   * @param password
+   * @param conf
    */
-  public JDBCAuthenticator(String url, String user, String password) {
-    this(url, "users", user, password);
+  public JDBCAuthenticator(HBaseConfiguration conf) {
+    this(conf.get("stargate.auth.jdbc.url"),
+      conf.get("stargate.auth.jdbc.table"),
+      conf.get("stargate.auth.jdbc.user"),
+      conf.get("stargate.auth.jdbc.password"));
   }
 
   /**

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
Sat Feb 27 00:23:19 2010
@@ -23,6 +23,7 @@
 import java.io.IOException;
 
 import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.stargate.Constants;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
 import org.apache.zookeeper.CreateMode;
@@ -45,10 +46,10 @@
  * 'name' (String, required), 'token' (String, optional), 'admin' (boolean,
  * optional), and 'disabled' (boolean, optional).
  */
-public class ZooKeeperAuthenticator extends Authenticator {
-
-  static final String USERS_ROOT_ZNODE = "/stargate/users";
+public class ZooKeeperAuthenticator extends Authenticator 
+    implements Constants {
 
+  final String usersZNode;
   ZooKeeperWrapper wrapper;
 
   private boolean ensureParentExists(final String znode) {
@@ -85,17 +86,20 @@
    * @throws IOException
    */
   public ZooKeeperAuthenticator(HBaseConfiguration conf) throws IOException {
-    this(new ZooKeeperWrapper(conf, new Watcher() {
+    this(conf, new ZooKeeperWrapper(conf, new Watcher() {
       public void process(WatchedEvent event) { }
     }));
-    ensureExists(USERS_ROOT_ZNODE);
+    ensureExists(USERS_ZNODE_ROOT);
   }
 
   /**
    * Constructor
+   * @param conf
    * @param wrapper
    */
-  public ZooKeeperAuthenticator(ZooKeeperWrapper wrapper) {
+  public ZooKeeperAuthenticator(HBaseConfiguration conf, 
+      ZooKeeperWrapper wrapper) {
+    this.usersZNode = conf.get("stargate.auth.zk.users", USERS_ZNODE_ROOT);
     this.wrapper = wrapper;
   }
 
@@ -103,7 +107,7 @@
   public User getUserForToken(String token) throws IOException {
     ZooKeeper zk = wrapper.getZooKeeper();
     try {
-      byte[] data = zk.getData(USERS_ROOT_ZNODE + "/" + token, null, null);
+      byte[] data = zk.getData(usersZNode + "/" + token, null, null);
       if (data == null) {
         return null;
       }

Added: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java?rev=916880&view=auto
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
(added)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
Sat Feb 27 00:23:19 2010
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hbase.stargate.metrics;
+
+import org.apache.hadoop.hbase.metrics.MetricsRate;
+
+import org.apache.hadoop.metrics.MetricsContext;
+import org.apache.hadoop.metrics.MetricsRecord;
+import org.apache.hadoop.metrics.MetricsUtil;
+import org.apache.hadoop.metrics.Updater;
+import org.apache.hadoop.metrics.jvm.JvmMetrics;
+import org.apache.hadoop.metrics.util.MetricsRegistry;
+
+public class StargateMetrics implements Updater {
+  private final MetricsRecord metricsRecord;
+  private final MetricsRegistry registry = new MetricsRegistry();
+  private final StargateStatistics stargateStatistics;
+
+  private MetricsRate requests = new MetricsRate("requests", registry);
+
+  public StargateMetrics() {
+    MetricsContext context = MetricsUtil.getContext("stargate");
+    metricsRecord = MetricsUtil.createRecord(context, "stargate");
+    String name = Thread.currentThread().getName();
+    metricsRecord.setTag("Master", name);
+    context.registerUpdater(this);
+    JvmMetrics.init("Stargate", name);
+    // expose the MBean for metrics
+    stargateStatistics = new StargateStatistics(registry);
+
+  }
+
+  public void shutdown() {
+    if (stargateStatistics != null) {
+      stargateStatistics.shutdown();
+    }
+  }
+
+  /**
+   * Since this object is a registered updater, this method will be called
+   * periodically, e.g. every 5 seconds.
+   * @param unused 
+   */
+  public void doUpdates(MetricsContext unused) {
+    synchronized (this) {
+      requests.pushMetric(metricsRecord);
+    }
+    this.metricsRecord.update();
+  }
+  
+  public void resetAllMinMax() {
+    // Nothing to do
+  }
+
+  /**
+   * @return Count of requests.
+   */
+  public float getRequests() {
+    return requests.getPreviousIntervalValue();
+  }
+  
+  /**
+   * @param inc How much to add to requests.
+   */
+  public void incrementRequests(final int inc) {
+    requests.inc(inc);
+  }
+
+}

Added: hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java?rev=916880&view=auto
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
(added)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
Sat Feb 27 00:23:19 2010
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hbase.stargate.metrics;
+
+import javax.management.ObjectName;
+
+import org.apache.hadoop.hbase.metrics.MetricsMBeanBase;
+
+import org.apache.hadoop.metrics.util.MBeanUtil;
+import org.apache.hadoop.metrics.util.MetricsRegistry;
+
+public class StargateStatistics  extends MetricsMBeanBase {
+  private final ObjectName mbeanName;
+
+  public StargateStatistics(MetricsRegistry registry) {
+    super(registry, "StargateStatistics");
+    mbeanName = MBeanUtil.registerMBean("Stargate", 
+      "StargateStatistics", this);
+  }
+
+  public void shutdown() {
+    if (mbeanName != null) {
+      MBeanUtil.unregisterMBean(mbeanName);
+    }
+  }
+
+}

Modified: hadoop/hbase/branches/0.20/src/contrib/stargate/src/test/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/stargate/src/test/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java?rev=916880&r1=916879&r2=916880&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/stargate/src/test/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/stargate/src/test/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java
Sat Feb 27 00:23:19 2010
@@ -46,9 +46,9 @@
   public void setUp() throws Exception {
     authenticator = new ZooKeeperAuthenticator(conf);
     ZooKeeper zk = authenticator.wrapper.getZooKeeper();
-    if (zk.exists(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" + 
+    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + 
           ADMIN_TOKEN, null) == null) {
-      zk.create(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" + ADMIN_TOKEN, 
+      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + ADMIN_TOKEN, 
         Bytes.toBytes(new JSONStringer()
           .object()
             .key("name").value(ADMIN_USERNAME)
@@ -56,9 +56,9 @@
           .endObject().toString()),
         Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     }
-    if (zk.exists(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" + 
+    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + 
           USER_TOKEN, null) == null) {
-      zk.create(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" + USER_TOKEN, 
+      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + USER_TOKEN, 
         Bytes.toBytes(new JSONStringer()
           .object()
             .key("name").value(USER_USERNAME)
@@ -66,9 +66,9 @@
           .endObject().toString()),
         Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     }
-    if (zk.exists(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" + 
+    if (zk.exists(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" + 
           DISABLED_TOKEN, null) == null) {
-      zk.create(ZooKeeperAuthenticator.USERS_ROOT_ZNODE + "/" +DISABLED_TOKEN,
+      zk.create(ZooKeeperAuthenticator.USERS_ZNODE_ROOT + "/" +DISABLED_TOKEN,
         Bytes.toBytes(new JSONStringer()
           .object()
             .key("name").value(DISABLED_USERNAME)



Mime
View raw message