Xikui Wang has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2448

Change subject: [NO ISSUE] Change the working directory of UDF
......................................................................

[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 "binary_path/lib/udfs".

Change-Id: I409039d0ca054069853653b312b9f6187365a73b
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java
1 file changed, 6 insertions(+), 14 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/48/2448/1

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..a5bf883 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,21 @@
     }
 
     /**
-     * @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/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) {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2448
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I409039d0ca054069853653b312b9f6187365a73b
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Xikui Wang <xkk...@gmail.com>

Reply via email to