Repository: oozie Updated Branches: refs/heads/branch-4.1 8ef50cbc2 -> b8122339b
OOZIE-1789 Support backward compatibility of oozie share lib (shwethags) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/b8122339 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/b8122339 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/b8122339 Branch: refs/heads/branch-4.1 Commit: b8122339b63c558f9d58ba9a3ede8b94c4ce16f7 Parents: 8ef50cb Author: Shwetha GS <[email protected]> Authored: Thu Oct 30 16:24:37 2014 +0530 Committer: Shwetha GS <[email protected]> Committed: Thu Oct 30 16:24:37 2014 +0530 ---------------------------------------------------------------------- .../apache/oozie/service/ShareLibService.java | 7 ++++-- .../oozie/service/TestShareLibService.java | 25 ++++++++++++++++++-- release-log.txt | 1 + 3 files changed, 29 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/b8122339/core/src/main/java/org/apache/oozie/service/ShareLibService.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/service/ShareLibService.java b/core/src/main/java/org/apache/oozie/service/ShareLibService.java index f91405d..4b51dd9 100644 --- a/core/src/main/java/org/apache/oozie/service/ShareLibService.java +++ b/core/src/main/java/org/apache/oozie/service/ShareLibService.java @@ -115,8 +115,7 @@ public class ShareLibService implements Service, Instrumentable { } catch(Throwable e) { if (failOnfailure) { LOG.error("Sharelib initialization fails", e); - throw new ServiceException(ErrorCode.E0104, getClass().getName(), "Sharelib initialization fails. " - + e.getMessage()); + throw new ServiceException(ErrorCode.E0104, getClass().getName(), "Sharelib initialization fails. ", e); } else { // We don't want to actually fail init by throwing an Exception, so only create the ServiceException and @@ -605,6 +604,10 @@ public class ShareLibService implements Service, Instrumentable { max = d; } } + //If there are no timestamped directories, fall back to root directory + if (path == null) { + path = rootDir; + } return path; } http://git-wip-us.apache.org/repos/asf/oozie/blob/b8122339/core/src/test/java/org/apache/oozie/service/TestShareLibService.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/service/TestShareLibService.java b/core/src/test/java/org/apache/oozie/service/TestShareLibService.java index 3707a0a..e74742f 100644 --- a/core/src/test/java/org/apache/oozie/service/TestShareLibService.java +++ b/core/src/test/java/org/apache/oozie/service/TestShareLibService.java @@ -394,13 +394,34 @@ public class TestShareLibService extends XFsTestCase { } @Test - public void testGetShareLibPath() throws Exception { + public void testGetShareLibCompatible() throws Exception { services = new Services(); setSystemProps(); FileSystem fs = getFileSystem(); - Date time = new Date(System.currentTimeMillis()); + Path basePath = new Path(services.getConf().get(WorkflowAppService.SYSTEM_LIB_PATH)); + + //Use basepath if there is no timestamped directory + fs.mkdirs(basePath); + Path pigPath = new Path(basePath.toString() + Path.SEPARATOR + "pig"); + fs.mkdirs(pigPath); + try { + services.init(); + ShareLibService shareLibService = Services.get().get(ShareLibService.class); + assertNotNull(shareLibService.getShareLibJars("pig")); + } finally { + services.destroy(); + } + } + @Test + public void testGetShareLibPath() throws Exception { + services = new Services(); + setSystemProps(); + FileSystem fs = getFileSystem(); Path basePath = new Path(services.getConf().get(WorkflowAppService.SYSTEM_LIB_PATH)); + + //Use timedstamped directory if available + Date time = new Date(System.currentTimeMillis()); Path libpath = new Path(basePath, ShareLibService.SHARED_LIB_PREFIX + ShareLibService.dateFormat.format(time)); fs.mkdirs(libpath); http://git-wip-us.apache.org/repos/asf/oozie/blob/b8122339/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 6c2ada3..7b0316b 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.1.0 release (4.1 - unreleased) +OOZIE-1789 Support backward compatibility of oozie share lib (shwethags) OOZIE-2047 Oozie does not support Hive tables that use datatypes introduced since Hive 0.8 (venkatnrangan via bzhang) OOZIE-2034 Disable SSLv3 (POODLEbleed vulnerability) (rkanter) OOZIE-1914 CLI should retry on timeout (puru)
