ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pallav...@apache.org
Subject ambari git commit: AMBARI-16707. Explain script on pig views encountered an IOExecption (Gaurav Nagar via pallavkul)
Date Thu, 19 May 2016 18:22:41 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4136ea74f -> fef680331


AMBARI-16707. Explain script on pig views encountered an IOExecption (Gaurav Nagar via pallavkul)


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

Branch: refs/heads/trunk
Commit: fef680331e741956997cc94ffc7aadbde6d0ac1c
Parents: 4136ea7
Author: Pallav Kulshreshtha <pallav.kul@gmail.com>
Authored: Thu May 19 23:52:20 2016 +0530
Committer: Pallav Kulshreshtha <pallav.kul@gmail.com>
Committed: Thu May 19 23:52:20 2016 +0530

----------------------------------------------------------------------
 .../view/pig/resources/jobs/JobResourceManager.java       | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fef68033/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/jobs/JobResourceManager.java
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/jobs/JobResourceManager.java
b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/jobs/JobResourceManager.java
index 2bd5745..c3bd504 100644
--- a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/jobs/JobResourceManager.java
+++ b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/jobs/JobResourceManager.java
@@ -168,12 +168,18 @@ public class JobResourceManager extends PersonalCRUDResourceManager<PigJob>
{
       // content can be passed from front-end with substituted arguments
       if (job.getForcedContent() != null && !job.getForcedContent().isEmpty()) {
         String forcedContent = job.getForcedContent();
-        URI uri = new URI(context.getProperties().get("webhdfs.url"));
+        String defaultUrl = context.getProperties().get("webhdfs.url");
+        URI uri = new URI(defaultUrl);
+
         // variable for sourceFile can be passed from front-end
         // cannot use webhdfs url as webhcat does not support http authentication
         // using url hdfs://host/sourcefilepath
+        if(uri.getScheme().equals("webhdfs")){
+          defaultUrl = "hdfs://" + uri.getHost();
+        }
+
         forcedContent = forcedContent.replace("${sourceFile}",
-            "hdfs://" + uri.getHost() + newSourceFilePath);
+            defaultUrl + newSourceFilePath);
         job.setForcedContent(null); // we should not store content in DB
         save(job);
 


Mime
View raw message