Michael Blow has submitted this change and it was merged. 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 "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 <[email protected]> Tested-by: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Reviewed-by: Till Westmann <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/external/ExternalLibraryUtils.java 1 file changed, 6 insertions(+), 16 deletions(-) Approvals: Anon. E. Moose #1000171: Till Westmann: Looks good to me, approved Jenkins: Verified; No violations found; ; Verified 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) { -- To view, visit https://asterix-gerrit.ics.uci.edu/2448 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I409039d0ca054069853653b312b9f6187365a73b Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Xikui Wang <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: Xikui Wang <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
