asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: More consistent indentation for HTTP API results
Date Tue, 28 Mar 2017 19:38:37 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 54ffece62 -> d6a122aed


More consistent indentation for HTTP API results

Change-Id: I448962aa77696ff4c3ab082ba97e9681df1cef56
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1623
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: d6a122aed6551b3a0f29271fee2beb2ea46ba062
Parents: 54ffece
Author: Till Westmann <tillw@apache.org>
Authored: Tue Mar 28 10:03:10 2017 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Tue Mar 28 12:38:18 2017 -0700

----------------------------------------------------------------------
 .../org/apache/asterix/api/http/server/ShutdownApiServlet.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d6a122ae/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/ShutdownApiServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/ShutdownApiServlet.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/ShutdownApiServlet.java
index 3493870..3d9602d 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/ShutdownApiServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/ShutdownApiServlet.java
@@ -28,6 +28,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.asterix.common.config.GlobalConfig;
+import org.apache.asterix.common.utils.JSONUtil;
 import org.apache.asterix.runtime.utils.ClusterStateManager;
 import org.apache.hyracks.api.client.IHyracksClientConnection;
 import org.apache.hyracks.http.api.IServletRequest;
@@ -76,7 +77,7 @@ public class ShutdownApiServlet extends AbstractServlet {
         ObjectNode jsonObject = om.createObjectNode();
         try {
             jsonObject.put("status", "SHUTTING_DOWN");
-            jsonObject.putPOJO("date", new Date());
+            jsonObject.put("date", new Date().toString());
             ObjectNode clusterState = ClusterStateManager.INSTANCE.getClusterStateDescription();
             ArrayNode ncs = (ArrayNode) clusterState.get("ncs");
             for (int i = 0; i < ncs.size(); i++) {
@@ -90,7 +91,7 @@ public class ShutdownApiServlet extends AbstractServlet {
             }
             jsonObject.set("cluster", clusterState);
             final PrintWriter writer = response.writer();
-            writer.print(om.writeValueAsString(jsonObject));
+            writer.print(JSONUtil.convertNode(jsonObject));
             writer.close();
         } catch (Exception e) {
             GlobalConfig.ASTERIX_LOGGER.log(Level.INFO, "Exception writing response", e);


Mime
View raw message