Github user davidyan74 commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/321#discussion_r61779550
  
    --- Diff: 
engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java ---
    @@ -492,6 +494,42 @@ public JSONObject 
getContainer(@PathParam("containerId") String containerId) thr
         return new JSONObject(objectMapper.writeValueAsString(ci));
       }
     
    +  @GET
    +  @Path(PATH_PHYSICAL_PLAN_CONTAINERS + "/{containerId}" + "/stackTrace")
    +  @Produces(MediaType.APPLICATION_JSON)
    +  public JSONObject getContainerStackTrace(@PathParam("containerId") 
String containerId) throws Exception
    +  {
    +    init();
    +
    +    if 
(containerId.equals(System.getenv(ApplicationConstants.Environment.CONTAINER_ID.toString())))
 {
    +      return new JSONObject(StackTrace.getJsonFormat());
    +    }
    +
    +    StreamingContainerAgent sca = 
dagManager.getContainerAgent(containerId);
    +
    +    if (sca == null) {
    +      throw new NotFoundException();
    +    }
    +
    +    if (!sca.getContainerInfo().state.equals("ACTIVE")) {
    +      throw new RuntimeException("Container is not active");
    +    }
    +
    +    int timeOut = 1000;
    --- End diff --
    
    We should probably make the constants 1000 and 10 be configurable, or at 
least make it a static final variable so that it's easily modified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to