hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [4/4] hbase git commit: HBASE-17962 Improve documentation on Rest interface
Date Fri, 28 Apr 2017 16:29:09 GMT
HBASE-17962 Improve documentation on Rest interface

Signed-off-by: Sean Busbey <busbey@apache.org>


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

Branch: refs/heads/master
Commit: fc68f23a4889271888ca8ba3fde1f6f86d3f0fce
Parents: 03e8f6b
Author: Niels Basjes <nbasjes@bol.com>
Authored: Wed Apr 26 11:21:39 2017 +0200
Committer: Sean Busbey <busbey@apache.org>
Committed: Fri Apr 28 11:28:29 2017 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/rest/RowResource.java | 8 +++++++-
 src/main/asciidoc/_chapters/external_apis.adoc              | 9 ++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fc68f23a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
index 7be4190..41b465f 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
@@ -139,7 +139,13 @@ public class RowResource extends ResourceBase {
     if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) {
       servlet.getMetrics().incrementFailedGetRequests(1);
       return Response.status(Response.Status.BAD_REQUEST).type(MIMETYPE_TEXT)
-          .entity("Bad request: Either 0 or more than 1 columns specified." + CRLF).build();
+          .entity("Bad request: Default 'GET' method only works if there is exactly 1 column
" +
+                  "in the row. Using the 'Accept' header with one of these formats lets you
" +
+                  "retrieve the entire row if it has multiple columns: " +
+                  // Same as the @Produces list for the get method.
+                  MIMETYPE_XML + ", " + MIMETYPE_JSON + ", " +
+                  MIMETYPE_PROTOBUF + ", " + MIMETYPE_PROTOBUF_IETF +
+                  CRLF).build();
     }
     MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
     try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/fc68f23a/src/main/asciidoc/_chapters/external_apis.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/external_apis.adoc b/src/main/asciidoc/_chapters/external_apis.adoc
index 556c4e0..2f85461 100644
--- a/src/main/asciidoc/_chapters/external_apis.adoc
+++ b/src/main/asciidoc/_chapters/external_apis.adoc
@@ -225,14 +225,17 @@ creation or mutation, and `DELETE` for deletion.
 |Description
 |Example
 
-|/_table_/_row_/_column:qualifier_/_timestamp_
+|/_table_/_row_
 |GET
-|Get the value of a single row. Values are Base-64 encoded.
+|Get all columns of a single row. Values are Base-64 encoded. This requires the "Accept"
request header with a type that can hold multiple columns (like xml, json or protobuf).
 |curl -vi -X GET \
   -H "Accept: text/xml" \
   "http://example.com:8000/users/row1"
 
-curl -vi -X GET \
+|/_table_/_row_/_column:qualifier_/_timestamp_
+|GET
+|Get the value of a single column. Values are Base-64 encoded.
+|curl -vi -X GET \
   -H "Accept: text/xml" \
   "http://example.com:8000/users/row1/cf:a/1458586888395"
 


Mime
View raw message