[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 <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
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 @@
}
/**
- * @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) {