apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tushargosavi <...@git.apache.org>
Subject [GitHub] incubator-apex-core pull request: APEX-103: Add module and dag int...
Date Thu, 10 Dec 2015 04:32:14 GMT
Github user tushargosavi commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/148#discussion_r47188066
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java ---
    @@ -668,25 +752,29 @@ public JSONObject getPort(@PathParam("operatorName") String operatorName,
@PathP
         if (logicalOperator == null) {
           throw new NotFoundException();
         }
    +
         try {
    -      for (LogicalPlan.InputPortMeta inputPort : logicalOperator.getInputStreams().keySet())
{
    -        if (portName.equals(portName)) {
    -          JSONObject port = new JSONObject();
    -          port.put("name", inputPort.getPortName());
    -          port.put("type", "input");
    -          return port;
    -        }
    -      }
    -      for (LogicalPlan.OutputPortMeta outputPort : logicalOperator.getOutputStreams().keySet())
{
    -        if (portName.equals(portName)) {
    -          JSONObject port = new JSONObject();
    -          port.put("name", outputPort.getPortName());
    -          port.put("type", "output");
    -          return port;
    -        }
    -      }
    +      JSONObject resp = getPortObject(logicalOperator.getInputStreams().keySet(), logicalOperator.getOutputStreams().keySet(),
portName);
    +      if (resp != null) return resp;
    +    } catch (JSONException ex) {
    +      throw new RuntimeException(ex);
         }
    -    catch (JSONException ex) {
    +    throw new NotFoundException();
    +  }
    +
    +  @GET
    +  @Path(PATH_LOGICAL_PLAN_MODULES + "/{moduleName}/ports/{portName}")
    +  @Produces(MediaType.APPLICATION_JSON)
    +  public JSONObject getProxyPort(@PathParam("moduleName") String moduleName, @PathParam("portName")
String portName)
    +  {
    +    ModuleMeta logicalModule = dagManager.getModuleMeta(moduleName);
    +    if (logicalModule == null) {
    +      throw new NotFoundException();
    +    }
    +    try {
    +      JSONObject resp = getPortObject(logicalModule.getInputStreams().keySet(), logicalModule.getOutputStreams().keySet(),
portName);
    +      if (resp != null) return resp;
    --- End diff --
    
    done


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message