flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetzger <...@git.apache.org>
Subject [GitHub] incubator-flink pull request: Finished Flink-928
Date Wed, 25 Jun 2014 15:00:21 GMT
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/43#discussion_r14190720
  
    --- Diff: stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/ConfigurationServlet.java
---
    @@ -71,7 +88,37 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
     		
     		PrintWriter w = resp.getWriter();
     		w.write(obj.toString());
    -
    +		
    +	}
    +	
    +	private void writeTaskmanagers(HttpServletResponse resp) throws IOException {
    +		
    +		Set<InstanceConnectionInfo> keys = jobmanager.getInstances().keySet();
    +		List<InstanceConnectionInfo> list = new ArrayList<InstanceConnectionInfo>(keys);
    +		Collections.sort(list);
    +		
    +		JSONObject obj = new JSONObject();
    +		JSONArray array = new JSONArray();
    +		for (InstanceConnectionInfo k : list) {
    +			JSONObject objInner = new JSONObject();
    +			try {
    +				objInner.put("inetAdress", k.getInetAdress());
    +				objInner.put("ipcPort", k.ipcPort());
    +				objInner.put("dataPort", k.dataPort());
    +				objInner.put("lastReceivedHeartBeat", jobmanager.getInstances().get(k).getLastHeartBeat());
    +				array.put(objInner);
    +			} catch (JSONException e) {
    +				e.printStackTrace();
    --- End diff --
    
    This is not good ;)
    Can you log the exception as a warn?
    LOG.warn("Json object creation failed", e); ?


---
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