hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [1/2] hbase git commit: HBASE-18615 hbase-rest tests fail in hbase-2.0.0-alpha2
Date Tue, 22 Aug 2017 00:23:40 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 55ba5d070 -> b059d8602


HBASE-18615 hbase-rest tests fail in hbase-2.0.0-alpha2

This makes branch-2 same as master branch. Makes hbase-rest tests pass.
Adds note on the jackson1 feature.

Signed-off-by: Michael Stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0be04ab4
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0be04ab4
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0be04ab4

Branch: refs/heads/branch-2
Commit: 0be04ab4a102430dd9a2259c9d98a1ae18a8693d
Parents: 55ba5d0
Author: Michael Stack <stack@apache.org>
Authored: Sat Aug 19 12:29:26 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Mon Aug 21 17:23:21 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java   | 4 +++-
 .../org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java    | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0be04ab4/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
index eb3fc26..9b38b98 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
@@ -235,7 +235,9 @@ public class RESTServer implements Constants {
 
     parseCommandLine(args, servlet);
 
-    // set up the Jersey servlet container for Jetty
+    // Set up the Jersey servlet container for Jetty
+    // The Jackson1Feature is a signal to Jersey that it should use jackson doing json.
+    // See here: https://stackoverflow.com/questions/39458230/how-register-jacksonfeature-on-clientconfig
     ResourceConfig application = new ResourceConfig().
         packages("org.apache.hadoop.hbase.rest").register(Jackson1Feature.class);
     ServletHolder sh = new ServletHolder(new ServletContainer(application));

http://git-wip-us.apache.org/repos/asf/hbase/blob/0be04ab4/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
index 298b954..c5cc121 100644
--- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
+++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java
@@ -34,6 +34,7 @@ import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 
+import org.glassfish.jersey.jackson1.Jackson1Feature;
 import org.glassfish.jersey.server.ResourceConfig;
 import org.glassfish.jersey.servlet.ServletContainer;
 
@@ -61,7 +62,8 @@ public class HBaseRESTTestingUtility {
     RESTServlet.getInstance(conf, UserProvider.instantiate(conf));
 
     // set up the Jersey servlet container for Jetty
-    ResourceConfig app = new ResourceConfig();
+    ResourceConfig app = new ResourceConfig().
+        packages("org.apache.hadoop.hbase.rest").register(Jackson1Feature.class);
     ServletHolder sh = new ServletHolder(new ServletContainer(app));
 
     // set up Jetty and run the embedded server


Mime
View raw message