hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1031928 - in /hbase/trunk: ./ src/main/java/org/apache/hadoop/hbase/rest/ src/test/java/org/apache/hadoop/hbase/rest/ src/test/java/org/apache/hadoop/hbase/rest/client/
Date Sat, 06 Nov 2010 02:05:04 GMT
Author: apurtell
Date: Sat Nov  6 02:05:03 2010
New Revision: 1031928

URL: http://svn.apache.org/viewvc?rev=1031928&view=rev
Log:
HBASE-3195 [rest] Fix TestTransform breakage on Hudson

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/Main.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestRowResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTransform.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdmin.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Sat Nov  6 02:05:03 2010
@@ -656,6 +656,7 @@ Release 0.21.0 - Unreleased
    HBASE-3203  We can get an order to open a region while shutting down
                and it'll hold up regionserver shutdown
    HBASE-3204  Reenable deferred log flush
+   HBASE-3195  [rest] Fix TestTransform breakage on Hudson
 
 
   IMPROVEMENTS
@@ -1114,6 +1115,7 @@ Release 0.21.0 - Unreleased
    HBASE-3201  Add accounting of empty regioninfo_qualifier rows in meta to
                hbasefsck.
 
+
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts
    HBASE-1982  [EC2] Handle potentially large and uneven instance startup times

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/Main.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/Main.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/Main.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/Main.java Sat Nov  6 02:05:03 2010
@@ -28,6 +28,8 @@ import org.apache.commons.cli.PosixParse
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
 
 import java.util.Arrays;
 import java.util.List;
@@ -97,7 +99,8 @@ public class Main implements Constants {
 
     // set up Jetty and run the embedded server
 
-    RESTServlet servlet = RESTServlet.getInstance();
+    Configuration conf = HBaseConfiguration.create();
+    RESTServlet servlet = RESTServlet.getInstance(conf);
     port = servlet.getConfiguration().getInt("hbase.rest.port", port);
 
     Server server = new Server(port);

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/rest/RESTServlet.java Sat Nov  6 02:05:03
2010
@@ -23,7 +23,6 @@ package org.apache.hadoop.hbase.rest;
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.client.HTablePool;
 import org.apache.hadoop.hbase.rest.metrics.RESTMetrics;
 
@@ -41,9 +40,7 @@ public class RESTServlet implements Cons
    * @throws IOException
    */
   public synchronized static RESTServlet getInstance() throws IOException {
-    if (INSTANCE == null) {
-      INSTANCE = new RESTServlet();
-    }
+    assert(INSTANCE != null);
     return INSTANCE;
   }
 
@@ -63,14 +60,6 @@ public class RESTServlet implements Cons
   public synchronized static void stop() {
     if (INSTANCE != null)  INSTANCE = null;
   }
-
-  /**
-   * Constructor
-   * @throws IOException
-   */
-  RESTServlet() throws IOException {
-    this(HBaseConfiguration.create());
-  }
   
   /**
    * Constructor with existing configuration

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java Sat
Nov  6 02:05:03 2010
@@ -33,19 +33,14 @@ public class HBaseRESTTestingUtility {
 
   static final Log LOG = LogFactory.getLog(HBaseRESTTestingUtility.class);
 
-  private Configuration conf;
   private int testServletPort;
   private Server server;
 
-  public HBaseRESTTestingUtility(Configuration conf) {
-    this.conf = conf;
-  }
-
   public int getServletPort() {
     return testServletPort;
   }
 
-  public void startServletContainer() throws Exception {
+  public void startServletContainer(Configuration conf) throws Exception {
     if (server != null) {
       LOG.error("ServletContainer already running");
       return;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestRowResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestRowResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestRowResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestRowResource.java Sat Nov  6
02:05:03 2010
@@ -66,7 +66,7 @@ public class TestRowResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
   private static Marshaller marshaller;
@@ -75,7 +75,7 @@ public class TestRowResource {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     context = JAXBContext.newInstance(
         CellModel.class,
         CellSetModel.class,

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannerResource.java Sat Nov
 6 02:05:03 2010
@@ -63,7 +63,7 @@ public class TestScannerResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
   private static Marshaller marshaller;
@@ -147,7 +147,7 @@ public class TestScannerResource {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     context = JAXBContext.newInstance(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestScannersWithFilters.java Sat
Nov  6 02:05:03 2010
@@ -108,7 +108,7 @@ public class TestScannersWithFilters {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
   private static Marshaller marshaller;
@@ -119,7 +119,7 @@ public class TestScannersWithFilters {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     context = JAXBContext.newInstance(
         CellModel.class,
         CellSetModel.class,

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestSchemaResource.java Sat Nov
 6 02:05:03 2010
@@ -48,14 +48,14 @@ public class TestSchemaResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     context = JAXBContext.newInstance(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestStatusResource.java Sat Nov
 6 02:05:03 2010
@@ -44,16 +44,15 @@ public class TestStatusResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
   
   private static void validate(StorageClusterStatusModel model) {
     assertNotNull(model);
-    assertTrue(model.getRegions() >= 2);
+    assertTrue(model.getRegions() >= 1);
     assertTrue(model.getRequests() >= 0);
-    // TODO: testing average load is flaky but not a stargate issue, revisit
-    // assertTrue(model.getAverageLoad() >= 1.0);
+    assertTrue(model.getAverageLoad() >= 0.0);
     assertNotNull(model.getLiveNodes());
     assertNotNull(model.getDeadNodes());
     assertFalse(model.getLiveNodes().isEmpty());
@@ -62,7 +61,6 @@ public class TestStatusResource {
       assertNotNull(node.getName());
       assertTrue(node.getStartCode() > 0L);
       assertTrue(node.getRequests() >= 0);
-      assertFalse(node.getRegions().isEmpty());
       for (StorageClusterStatusModel.Node.Region region: node.getRegions()) {
         if (Bytes.equals(region.getName(), ROOT_REGION_NAME)) {
           foundRoot = true;
@@ -77,8 +75,8 @@ public class TestStatusResource {
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
-    TEST_UTIL.startMiniCluster(2); // some tests depend on having only 2 RS
-    REST_TEST_UTIL.startServletContainer();
+    TEST_UTIL.startMiniCluster(3);
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     context = JAXBContext.newInstance(StorageClusterStatusModel.class);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTableResource.java Sat Nov
 6 02:05:03 2010
@@ -65,14 +65,14 @@ public class TestTableResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     context = JAXBContext.newInstance(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTransform.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTransform.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTransform.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestTransform.java Sat Nov  6 02:05:03
2010
@@ -50,13 +50,13 @@ public class TestTransform {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/TestVersionResource.java Sat Nov
 6 02:05:03 2010
@@ -48,14 +48,14 @@ public class TestVersionResource {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static Client client;
   private static JAXBContext context;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     client = new Client(new Cluster().add("localhost", 
       REST_TEST_UTIL.getServletPort()));
     context = JAXBContext.newInstance(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdmin.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdmin.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteAdmin.java Sat
Nov  6 02:05:03 2010
@@ -52,14 +52,14 @@ public class TestRemoteAdmin {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static HBaseAdmin localAdmin;
   private static RemoteAdmin remoteAdmin;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     localAdmin = TEST_UTIL.getHBaseAdmin();
     remoteAdmin = new RemoteAdmin(new Client(
       new Cluster().add("localhost", REST_TEST_UTIL.getServletPort())),

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java?rev=1031928&r1=1031927&r2=1031928&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java Sat
Nov  6 02:05:03 2010
@@ -70,13 +70,13 @@ public class TestRemoteTable {
 
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final HBaseRESTTestingUtility REST_TEST_UTIL = 
-    new HBaseRESTTestingUtility(TEST_UTIL.getConfiguration());
+    new HBaseRESTTestingUtility();
   private static RemoteHTable remoteTable;
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(3);
-    REST_TEST_UTIL.startServletContainer();
+    REST_TEST_UTIL.startServletContainer(TEST_UTIL.getConfiguration());
     HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
     LOG.info("Admin Connection=" + admin.getConnection() + ", " + 
       admin.getConnection().getZooKeeperWatcher());



Mime
View raw message