You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by vr...@apache.org on 2017/07/28 01:48:07 UTC

[apex-core] branch master updated: APEXCORE-765 During retrieval of web service connection information for web service clients, if permission file is not present, logging an information message instead of exception trace so as to not cause concern to the user unnecessarily.

This is an automated email from the ASF dual-hosted git repository.

vrozov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apex-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ae9433  APEXCORE-765 During retrieval of web service connection information for web service clients, if permission file is not present, logging an information message instead of exception trace so as to not cause concern to the user unnecessarily.
6ae9433 is described below

commit 6ae9433971c225c3bc3cdb8c8b7ef1860009fadf
Author: Pramod Immaneni <pr...@datatorrent.com>
AuthorDate: Wed Jul 19 11:29:58 2017 -0700

    APEXCORE-765 During retrieval of web service connection information for web service clients, if permission file is not present, logging an information message instead of exception trace so as to not cause concern to the user unnecessarily.
---
 .../java/com/datatorrent/stram/client/StramAgent.java | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java b/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
index ce7507d..2d908b3 100644
--- a/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
+++ b/engine/src/main/java/com/datatorrent/stram/client/StramAgent.java
@@ -411,11 +411,22 @@ public class StramAgent extends FSAgent
       String appPath = response.getString("appPath");
       String user = response.getString("user");
       JSONObject permissionsInfo = null;
-      try (FSDataInputStream is = fileSystem.open(new Path(appPath, "permissions.json"))) {
-        permissionsInfo = new JSONObject(IOUtils.toString(is));
+      Path permissionsPath = new Path(appPath, "permissions.json");
+      LOG.debug("Checking for permission information in file {}", permissionsPath);
+      try {
+        if (fileSystem.exists(permissionsPath)) {
+          LOG.info("Loading permission information");
+          try (FSDataInputStream is = fileSystem.open(permissionsPath)) {
+            permissionsInfo = new JSONObject(IOUtils.toString(is));
+          }
+          LOG.debug("Loaded permission file successfully");
+        } else {
+          // ignore and log messages if file is not found
+          LOG.info("Permission information is not available as the application is not configured with it");
+        }
       } catch (IOException ex) {
-        // ignore if file is not found
-        LOG.info("Exception in accessing permissions.json", ex);
+        // ignore and log message when unable to read the file
+        LOG.info("Permission information is not available", ex);
       }
       return new StramWebServicesInfo(appMasterUrl, version, appPath, user, secToken, permissionsInfo);
     } catch (Exception ex) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@apex.apache.org" <co...@apex.apache.org>'].