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/02/10 03:14:21 UTC

falcon git commit: FALCON-2277 Error msg while registering extensions

Repository: falcon
Updated Branches:
  refs/heads/master bf027e169 -> 217ea0099


FALCON-2277 Error msg while registering extensions

Author: Pracheer Agarwal <pr...@inmobi.com>
Author: Pracheer Agarwal <pr...@gmail.com>
Author: Pracheer Agarwal <pr...@im2216-x0.corp.inmobi.com>

Reviewers: @pallavi-rao

Closes #363 from PracheerAgarwal/register and squashes the following commits:

1c59097 [Pracheer Agarwal] review comment changes
f52be5e [Pracheer Agarwal] Error msg while registering extensions
ba60452 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
ed65aa0 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9ff05df [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9c2f0a5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9cd8c17 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
778c579 [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e39808d [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a932633 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
fda3b28 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a93d71a [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e3728d5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
066c8e2 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
b20f044 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
7f572a1 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
46042fd [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
daa3ffc [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions
622cae4 [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions


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

Branch: refs/heads/master
Commit: 217ea0099de4302c9e443eabb35820e64a0e98cc
Parents: bf027e1
Author: Pracheer Agarwal <pr...@inmobi.com>
Authored: Fri Feb 10 08:44:14 2017 +0530
Committer: Pallavi Rao <pa...@inmobi.com>
Committed: Fri Feb 10 08:44:14 2017 +0530

----------------------------------------------------------------------
 .../falcon/extensions/store/ExtensionStore.java | 70 ++++++++++----------
 1 file changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/217ea009/extensions/src/main/java/org/apache/falcon/extensions/store/ExtensionStore.java
----------------------------------------------------------------------
diff --git a/extensions/src/main/java/org/apache/falcon/extensions/store/ExtensionStore.java b/extensions/src/main/java/org/apache/falcon/extensions/store/ExtensionStore.java
index ed42b6b..6fc04aa 100644
--- a/extensions/src/main/java/org/apache/falcon/extensions/store/ExtensionStore.java
+++ b/extensions/src/main/java/org/apache/falcon/extensions/store/ExtensionStore.java
@@ -278,46 +278,46 @@ public final class ExtensionStore {
 
     public String registerExtension(final String extensionName, final String path, final String description,
                                     String extensionOwner) throws URISyntaxException, FalconException {
-        URI uri = new URI(path);
-        assertURI("Scheme", uri.getScheme());
-        assertURI("Authority", uri.getAuthority());
-        assertURI("Path", uri.getPath());
-        FileSystem fileSystem = getHdfsFileSystem(path);
-        try {
-            fileSystem.listStatus(new Path(uri.getPath() + "/README"));
-        } catch (IOException e) {
-            LOG.error("Exception in registering Extension:{}", extensionName, e);
-            throw new ValidationException("README file is not present in the " + path);
-        }
-        PathFilter filter = new PathFilter() {
-            public boolean accept(Path file) {
-                return file.getName().endsWith(".jar");
+        if (!metaStore.checkIfExtensionExists(extensionName)) {
+            URI uri = new URI(path);
+            assertURI("Scheme", uri.getScheme());
+            assertURI("Authority", uri.getAuthority());
+            assertURI("Path", uri.getPath());
+            FileSystem fileSystem = getHdfsFileSystem(path);
+            try {
+                fileSystem.listStatus(new Path(uri.getPath() + "/README"));
+            } catch (IOException e) {
+                LOG.error("Exception in registering Extension:{}", extensionName, e);
+                throw new ValidationException("README file is not present in the " + path);
             }
-        };
-        FileStatus[] jarStatus;
-        try {
-            jarStatus = fileSystem.listStatus(new Path(uri.getPath(), "libs/build"), filter);
-            if (jarStatus.length <= 0) {
+            PathFilter filter = new PathFilter() {
+                public boolean accept(Path file) {
+                    return file.getName().endsWith(".jar");
+                }
+            };
+            FileStatus[] jarStatus;
+            try {
+                jarStatus = fileSystem.listStatus(new Path(uri.getPath(), "libs/build"), filter);
+                if (jarStatus.length <= 0) {
+                    throw new ValidationException("Jars are not present in the " + uri.getPath() + "/libs/build.");
+                }
+            } catch (IOException e) {
+                LOG.error("Exception in registering Extension:{}", extensionName, e);
                 throw new ValidationException("Jars are not present in the " + uri.getPath() + "/libs/build.");
             }
-        } catch (IOException e) {
-            LOG.error("Exception in registering Extension:{}", extensionName, e);
-            throw new ValidationException("Jars are not present in the " + uri.getPath() + "/libs/build.");
-        }
-        FileStatus[] propStatus;
-        try {
-            propStatus = fileSystem.listStatus(new Path(uri.getPath() , "META"));
-            if (propStatus.length <= 0) {
-                throw new ValidationException("No properties file is not present in the " + uri.getPath() + "/META"
+
+            FileStatus[] propStatus;
+            try {
+                propStatus = fileSystem.listStatus(new Path(uri.getPath() , "META"));
+                if (propStatus.length <= 0) {
+                    throw new ValidationException("No properties file is not present in the " + uri.getPath() + "/META"
+                            + " structure.");
+                }
+            } catch (IOException e) {
+                LOG.error("Exception in registering Extension:{}", extensionName, e);
+                throw new ValidationException("Directory is not present in the " + uri.getPath() + "/META"
                         + " structure.");
             }
-        } catch (IOException e) {
-            LOG.error("Exception in registering Extension:{}", extensionName, e);
-            throw new ValidationException("Directory is not present in the " + uri.getPath() + "/META"
-                    + " structure.");
-        }
-
-        if (!metaStore.checkIfExtensionExists(extensionName)) {
             metaStore.storeExtensionBean(extensionName, path, ExtensionType.CUSTOM, description, extensionOwner);
         } else {
             throw new ValidationException(extensionName + " already exists.");