Repository: asterixdb
Updated Branches:
  refs/heads/master 0af313c33 -> c49e25e28


[NO ISSUE] Change the working directory of UDF

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
Currently, there are two places for hosting UDFs. One is
"user.home/library", and the other is "app.home/lib/udfs". The former
one was used by Managix and is no longer supported. It also causes
problem for OSX users since it's collided with the system folder. From
now on, all udfs are placed under "app.home/lib/udfs". In the case where
"app.home" is not defined, "user.home/lib/udfs" will be used.

Change-Id: I409039d0ca054069853653b312b9f6187365a73b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2448
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>


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

Branch: refs/heads/master
Commit: c49e25e285c34311b50221c4d3f07bf677a1296f
Parents: 0af313c
Author: Xikui Wang <xkk...@gmail.com>
Authored: Tue Mar 6 22:37:11 2018 -0800
Committer: Michael Blow <mb...@apache.org>
Committed: Sat Mar 10 14:47:49 2018 -0800

----------------------------------------------------------------------
 .../app/external/ExternalLibraryUtils.java      | 22 ++++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c49e25e2/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
index c125a40..0af1b9d 100755
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
@@ -400,29 +400,19 @@ public class ExternalLibraryUtils {
     }
 
     /**
-     * @return the directory "$(ControllerConfig.defaultDir)/library": This 
needs to be improved
+     * @return the directory "System.getProperty("app.home", 
System.getProperty("user.home")/lib/udfs"
      */
     protected static File getLibraryInstallDir() {
-        // Check managix directory first. If not exists, check app home.
-        File installDir = new File(System.getProperty("user.dir"), "library");
-        if (!installDir.exists()) {
-            installDir = new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator
-                    + "lib" + File.separator + "udfs");
-        }
-        return installDir;
+        return new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator + "lib"
+                + File.separator + "udfs");
     }
 
     /**
-     * @return the directory "$(ControllerConfig.defaultDir)/uninstall": This 
needs to be improved
+     * @return the directory "System.getProperty("app.home", 
System.getProperty("user.home")/lib/udfs/uninstall"
      */
     protected static File getLibraryUninstallDir() {
-        // Check managix directory first. If not exists, check app home.
-        File uninstallDir = new File(System.getProperty("user.dir"), 
"uninstall");
-        if (!uninstallDir.exists()) {
-            uninstallDir = new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator
-                    + "lib" + File.separator + "udfs" + File.separator + 
"uninstall");
-        }
-        return uninstallDir;
+        return new File(System.getProperty("app.home", 
System.getProperty("user.home")) + File.separator + "lib"
+                + File.separator + "udfs" + File.separator + "uninstall");
     }
 
     public static String getExternalFunctionFullName(String libraryName, 
String functionName) {

Reply via email to