trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arvi...@apache.org
Subject [1/2] incubator-trafodion git commit: Fix for REST Server pstack api
Date Tue, 09 Feb 2016 17:34:34 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 3aef62173 -> 93f104591


Fix for REST Server pstack api


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/53a561c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/53a561c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/53a561c5

Branch: refs/heads/master
Commit: 53a561c539fcea43e818e934f42fd338832e1ede
Parents: 3aef621
Author: Venkat Muthuswamy <venkat.muthuswamy@esgyn.com>
Authored: Mon Feb 8 10:44:47 2016 -0800
Committer: Venkat Muthuswamy <venkat.muthuswamy@esgyn.com>
Committed: Mon Feb 8 10:44:47 2016 -0800

----------------------------------------------------------------------
 .../java/org/trafodion/rest/ServerResource.java | 30 +++++++-------------
 1 file changed, 11 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a561c5/core/rest/src/main/java/org/trafodion/rest/ServerResource.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/ServerResource.java b/core/rest/src/main/java/org/trafodion/rest/ServerResource.java
index 3f9490f..0dd623a 100644
--- a/core/rest/src/main/java/org/trafodion/rest/ServerResource.java
+++ b/core/rest/src/main/java/org/trafodion/rest/ServerResource.java
@@ -23,38 +23,28 @@
 
 package org.trafodion.rest;
 
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.util.List;
+import java.util.Scanner;
 
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.CacheControl;
 import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Request;
 import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response.ResponseBuilder;
+import javax.ws.rs.core.UriInfo;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.apache.hadoop.conf.Configuration;
-
 import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-
-import org.trafodion.rest.script.ScriptManager;
 import org.trafodion.rest.script.ScriptContext;
-import org.trafodion.rest.Constants;
-import org.trafodion.rest.util.Bytes;
-import org.trafodion.rest.util.RestConfiguration;
-import org.trafodion.rest.zookeeper.ZkClient;
-import org.trafodion.rest.RestConstants;
+import org.trafodion.rest.script.ScriptManager;
 
 public class ServerResource extends ResourceBase {
 	private static final Log LOG =
@@ -256,11 +246,13 @@ public class ServerResource extends ResourceBase {
 	            String line = scanner.nextLine();
 	            if(line.contains("pstack-ing")) {
 	                continue;
-	            } else if (line.contains("pstack")) {
-	                if(pstack == true) {
+				} else if (line.contains("pstack") || line.startsWith("--")) {
+					if (pstack == true && sb.length() > 0) {
 	                    json.put(new JSONObject().put("PROGRAM", sb.toString()));
 	                    sb.setLength(0);
-	                    sb.append(line + "\n");
+						if (line.contains("pstack"))
+							sb.append(line + "\n");
+						pstack = false;
 	                } else {
 	                    pstack = true;
 	                    sb.append(line + "\n");


Mime
View raw message