asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xi...@apache.org
Subject asterixdb git commit: [ASTERIXDB-2057][API] Add detailed error message for 500 in REST API
Date Wed, 23 Aug 2017 18:21:41 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master f35b27738 -> 78b1a694b


[ASTERIXDB-2057][API] Add detailed error message for 500 in REST API

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
1. Add error message to 500 response.
2. Specify proper content type for Ansible query execution script, so
LIKE % can be parsed properly.
3. Add semicolons to statements in create.sqlpp.

Change-Id: I17759141116a1baf878abf7d5ec70295a18946e8
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1959
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


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

Branch: refs/heads/master
Commit: 78b1a694bb6d84a8298a1cb4986fa322f6ccc0ae
Parents: f35b277
Author: Xikui Wang <xkkwww@gmail.com>
Authored: Wed Aug 23 10:09:34 2017 -0700
Committer: Xikui Wang <xkkwww@gmail.com>
Committed: Wed Aug 23 11:21:12 2017 -0700

----------------------------------------------------------------------
 .../src/main/resources/ansible/runquery.yml         |  2 ++
 .../resources/benchmarks/tpch/setup/create.sqlpp    | 16 ++++++++--------
 .../hyracks/http/server/HttpServerHandler.java      |  2 +-
 3 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/78b1a694/asterixdb/asterix-benchmark/src/main/resources/ansible/runquery.yml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-benchmark/src/main/resources/ansible/runquery.yml b/asterixdb/asterix-benchmark/src/main/resources/ansible/runquery.yml
index ef3c2a5..a8af486 100644
--- a/asterixdb/asterix-benchmark/src/main/resources/ansible/runquery.yml
+++ b/asterixdb/asterix-benchmark/src/main/resources/ansible/runquery.yml
@@ -34,6 +34,8 @@
         url: "{{ service }}"
         method: POST
         body: "{{ lookup('file', query_file ) }}"
+        headers:
+          Content-Type: "text/plain"
         timeout: 3600
       register: response
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/78b1a694/asterixdb/asterix-benchmark/src/main/resources/benchmarks/tpch/setup/create.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-benchmark/src/main/resources/benchmarks/tpch/setup/create.sqlpp
b/asterixdb/asterix-benchmark/src/main/resources/benchmarks/tpch/setup/create.sqlpp
index 2aa67c6..799f445 100644
--- a/asterixdb/asterix-benchmark/src/main/resources/benchmarks/tpch/setup/create.sqlpp
+++ b/asterixdb/asterix-benchmark/src/main/resources/benchmarks/tpch/setup/create.sqlpp
@@ -34,7 +34,7 @@ create type LineItemType as {
   l_shipinstruct: string,
   l_shipmode: string,
   l_comment: string
-}
+};
 
 create type OrderType as {
   o_orderkey: int64,
@@ -46,7 +46,7 @@ create type OrderType as {
   o_clerk: string,
   o_shippriority: int32,
   o_comment: string
-}
+};
 
 create type CustomerType as {
   c_custkey: int64,
@@ -57,7 +57,7 @@ create type CustomerType as {
   c_acctbal: double,
   c_mktsegment: string,
   c_comment: string
-}
+};
 
 create type PartType as {
   p_partkey: int64,
@@ -69,7 +69,7 @@ create type PartType as {
   p_container: string,
   p_retailprice: double,
   p_comment: string
-}
+};
 
 create type PartSuppType as {
   ps_partkey: int64,
@@ -77,7 +77,7 @@ create type PartSuppType as {
   ps_availqty: int32,
   ps_supplycost: double,
   ps_comment: string
-}
+};
 
 create type SupplierType as {
   s_suppkey: int64,
@@ -87,20 +87,20 @@ create type SupplierType as {
   s_phone: string,
   s_acctbal: double,
   s_comment: string
-}
+};
 
 create type NationType as {
   n_nationkey: int32,
   n_name: string,
   n_regionkey: int32,
   n_comment: string
-}
+};
 
 create type RegionType as {
   r_regionkey: int32,
   r_name: string,
   r_comment: string
-}
+};
 
 create dataset LineItem(LineItemType) primary key l_orderkey, l_linenumber;
 create dataset Orders(OrderType)      primary key o_orderkey;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/78b1a694/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
index e89ed56..46b693b 100644
--- a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
+++ b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
@@ -72,7 +72,7 @@ public class HttpServerHandler<T extends HttpServer> extends SimpleChannelInboun
             }
         } catch (Exception e) {
             LOGGER.log(Level.SEVERE, "Failure Submitting HTTP Request", e);
-            respond(ctx, request.protocolVersion(), HttpResponseStatus.INTERNAL_SERVER_ERROR);
+            respond(ctx, request.protocolVersion(), new HttpResponseStatus(500, e.getMessage()));
         }
     }
 


Mime
View raw message