You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by pa...@apache.org on 2017/01/11 09:55:48 UTC

falcon git commit: FALCON-2242 Logging Extension Builder's exceptions to client logs

Repository: falcon
Updated Branches:
  refs/heads/master 44da87023 -> ae510daa2


FALCON-2242 Logging Extension Builder's exceptions to client logs

Author: sandeep <sa...@gmail.com>

Reviewers: @pallavi-rao

Closes #340 from sandeepSamudrala/FALCON-2242 and squashes the following commits:

3e1c61f [sandeep] checkstyle issue fixed
7485a34 [sandeep] incorporated review comments
b30c8f2 [sandeep] incorporated review comments
ec89ac8 [sandeep] removing not related changes
0e6f99e [sandeep] error messaging colon
f39e6e9 [sandeep] FACLON-2242 Logging Extension Builder's exceptions to client logs
79e7a12 [sandeep] FACLON-2242 Logging Extension Builder's exceptions to client logs
607c0ce [sandeep] Merge branch 'master' of https://github.com/apache/falcon into FALCON-2242
a234d94 [sandeep] FALCON-2231 Incoporated review comments and small fixes for duplicate submission and colo addition to schedule command
26e3350 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
73fbf75 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
cc28658 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
089b10d [sandeep] Merge branch 'master' of https://github.com/apache/falcon
456d4ee [sandeep] Merge branch 'master' of https://github.com/apache/falcon
0cf9af6 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
4a2e23e [sandeep] Merge branch 'master' of https://github.com/apache/falcon
b1546ed [sandeep] Merge branch 'master' of https://github.com/apache/falcon
0a433fb [sandeep] Merge branch 'master' of https://github.com/apache/falcon
194f36a [sandeep] Merge branch 'master' of https://github.com/apache/falcon
e0ad358 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
f96a084 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
9cf36e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
bbca081 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
48f6afa [sandeep] Merge branch 'master' of https://github.com/apache/falcon
250cc46 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
d0393e9 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
a178805 [sandeep] Merge branch 'master' of https://github.com/apache/falcon
d6dc8bf [sandeep] Merge branch 'master' of https://github.com/apache/falcon
1bb8d3c [sandeep] Merge branch 'master' of https://github.com/apache/falcon
c065566 [sandeep] reverting last line changes made
1a4dcd2 [sandeep] rebased and resolved the conflicts from master
271318b [sandeep] FALCON-2097. Adding UT to the new method for getting next instance time with Delay.
a94d4fe [sandeep] rebasing from master
9e68a57 [sandeep] FALCON-298. Feed update with replication delay creates holes


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/ae510daa
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/ae510daa
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/ae510daa

Branch: refs/heads/master
Commit: ae510daa2fa693e0900a305533cb59bb11b2bc77
Parents: 44da870
Author: sandeep <sa...@gmail.com>
Authored: Wed Jan 11 15:25:35 2017 +0530
Committer: Pallavi Rao <pa...@inmobi.com>
Committed: Wed Jan 11 15:25:35 2017 +0530

----------------------------------------------------------------------
 .../apache/falcon/cli/FalconExtensionCLI.java    |  1 +
 .../org/apache/falcon/client/FalconClient.java   | 19 +++++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/ae510daa/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
index d1f2e41..2101d65 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
@@ -131,6 +131,7 @@ public class FalconExtensionCLI extends FalconCLI{
             result = client.updateExtensionJob(jobName, filePath, doAsUser).getMessage();
         } else if (optionsList.contains(FalconCLIConstants.VALIDATE_OPT)) {
             validateRequiredParameter(extensionName, EXTENSION_NAME_OPT);
+            validateRequiredParameter(jobName, JOB_NAME_OPT);
             validateRequiredParameter(filePath, FalconCLIConstants.FILE_PATH_OPT);
             result = client.validateExtensionJob(extensionName, jobName, filePath, doAsUser).getMessage();
         } else if (optionsList.contains(FalconCLIConstants.SCHEDULE_OPT)) {

http://git-wip-us.apache.org/repos/asf/falcon/blob/ae510daa/client/src/main/java/org/apache/falcon/client/FalconClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/client/FalconClient.java b/client/src/main/java/org/apache/falcon/client/FalconClient.java
index a5fb54c..ab98f4a 100644
--- a/client/src/main/java/org/apache/falcon/client/FalconClient.java
+++ b/client/src/main/java/org/apache/falcon/client/FalconClient.java
@@ -25,6 +25,7 @@ import com.sun.jersey.api.client.config.DefaultClientConfig;
 import com.sun.jersey.client.urlconnection.HTTPSProperties;
 import com.sun.jersey.multipart.FormDataMultiPart;
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.net.util.TrustManagerUtils;
 import org.apache.falcon.LifeCycle;
@@ -52,6 +53,8 @@ import org.apache.hadoop.security.authentication.client.KerberosAuthenticator;
 import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.HttpsURLConnection;
@@ -81,6 +84,7 @@ import java.util.concurrent.atomic.AtomicReference;
 public class FalconClient extends AbstractFalconClient {
 
     public static final AtomicReference<PrintStream> OUT = new AtomicReference<>(System.out);
+    public static final Logger LOG = LoggerFactory.getLogger(FalconClient.class);
 
     public static final String WS_HEADER_PREFIX = "header:";
     public static final String USER = System.getProperty("user.name");
@@ -187,6 +191,7 @@ public class FalconClient extends AbstractFalconClient {
             client.resource(UriBuilder.fromUri(baseUrl).build());
             authenticationToken = getToken(baseUrl);
         } catch (Exception e) {
+            LOG.error("Unable to initialize Falcon Client object. Cause : ", e);
             throw new FalconCLIException("Unable to initialize Falcon Client object. Cause : " + e.getMessage(), e);
         }
     }
@@ -1107,7 +1112,8 @@ public class FalconClient extends AbstractFalconClient {
         try {
             formDataMultiPart.close();
         } catch (IOException e) {
-            throw new FalconCLIException("Submit failed. Failed to submit entities", e);
+            LOG.error("Submit failed. Failed to submit entities. Cause: ", e);
+            throw new FalconCLIException("Submit failed. Failed to submit entities:" + e.getMessage(), e);
         }
         return formDataMultiPart;
     }
@@ -1132,17 +1138,20 @@ public class FalconClient extends AbstractFalconClient {
         try {
             extensionDetailJson = new JSONObject(getResponse(APIResult.class, clientResponse).getMessage());
         } catch (JSONException e) {
-            throw new FalconCLIException("Failed to get details for the given extension", e);
+            LOG.error("Failed to get details for the given extension. Cause: ", e);
+            throw new FalconCLIException("Failed to get details for the given extension:" + e.getMessage(), e);
         }
         return extensionDetailJson;
     }
+
     private JSONObject getExtensionJobDetailJson(String jobName) {
         ClientResponse clientResponse = getExtensionJobDetailsResponse(jobName);
         JSONObject extensionJobDetailJson;
         try {
             extensionJobDetailJson = new JSONObject(getResponse(APIResult.class, clientResponse).getMessage());
         } catch (JSONException e) {
-            throw new FalconCLIException("Failed to get details for the given extension", e);
+            LOG.error("Failed to get details for the given extension. Cause: ", e);
+            throw new FalconCLIException("Failed to get details for the given extension:" + e.getMessage(), e);
         }
         return extensionJobDetailJson;
     }
@@ -1155,7 +1164,9 @@ public class FalconClient extends AbstractFalconClient {
                 entities = ExtensionHandler.loadAndPrepare(extensionName, jobName, configStream,
                         extensionBuildLocation);
             } catch (Exception e) {
-                throw new FalconCLIException("Error in building the extension", e);
+                LOG.error("Error in building the extension. Cause: ", e);
+                OUT.get().println("Error in building the extension:" + ExceptionUtils.getFullStackTrace(e));
+                throw new FalconCLIException("Error in building the extension:" + e.getMessage(), e);
             }
             if (entities == null || entities.isEmpty()) {
                 throw new FalconCLIException("No entities got built for the given extension");