Repository: oozie Updated Branches: refs/heads/master a94011bcb -> d1caebb53
OOZIE-1428 The delay time for requeue should be configurable (sree2k via rkanter) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/d1caebb5 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/d1caebb5 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/d1caebb5 Branch: refs/heads/master Commit: d1caebb531b706a5c235abc5f04576235324da46 Parents: a94011b Author: Robert Kanter <[email protected]> Authored: Fri Aug 29 15:44:27 2014 -0700 Committer: Robert Kanter <[email protected]> Committed: Fri Aug 29 15:44:27 2014 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/oozie/command/XCommand.java | 10 +++++++--- core/src/main/resources/oozie-default.xml | 14 +++++++++++--- .../java/org/apache/oozie/command/TestXCommand.java | 6 ++++++ release-log.txt | 1 + 4 files changed, 25 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/d1caebb5/core/src/main/java/org/apache/oozie/command/XCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/XCommand.java b/core/src/main/java/org/apache/oozie/command/XCommand.java index 7f73a1e..96403cb 100644 --- a/core/src/main/java/org/apache/oozie/command/XCommand.java +++ b/core/src/main/java/org/apache/oozie/command/XCommand.java @@ -60,7 +60,7 @@ public abstract class XCommand<T> implements XCallable<T> { public static final String INSTRUMENTATION_GROUP = "commands"; - public static final Long DEFAULT_REQUEUE_DELAY = 10L; + public static final String DEFAULT_REQUEUE_DELAY = "oozie.command.default.requeue.delay"; public XLog LOG = XLog.getLog(getClass()); @@ -503,11 +503,15 @@ public abstract class XCommand<T> implements XCallable<T> { /** * Return the delay time for requeue + * <p/> + * The value is loaded from the Oozie configuration, the property {link #DEFAULT_REQUEUE_DELAY}. + * <p/> + * Subclasses should override this method if they want to use a different requeue delay time * * @return delay time when requeue itself */ - protected Long getRequeueDelay() { - return DEFAULT_REQUEUE_DELAY; + protected long getRequeueDelay() { + return Services.get().getConf().getLong(DEFAULT_REQUEUE_DELAY, 10 * 1000L); } /** http://git-wip-us.apache.org/repos/asf/oozie/blob/d1caebb5/core/src/main/resources/oozie-default.xml ---------------------------------------------------------------------- diff --git a/core/src/main/resources/oozie-default.xml b/core/src/main/resources/oozie-default.xml index ebceaa7..3a957d0 100644 --- a/core/src/main/resources/oozie-default.xml +++ b/core/src/main/resources/oozie-default.xml @@ -1736,7 +1736,7 @@ library path are used. </description> </property> - + <property> <name>oozie.command.default.lock.timeout</name> <value>5000</value> @@ -1744,7 +1744,15 @@ Default timeout (in milliseconds) for commands for acquiring an exclusive lock on an entity. </description> </property> - + + <property> + <name>oozie.command.default.requeue.delay</name> + <value>10000</value> + <description> + Default time (in milliseconds) for commands that are requeued for delayed execution. + </description> + </property> + <!-- LiteWorkflowStoreService, Workflow Action Automatic Retry --> <property> @@ -1754,7 +1762,7 @@ Automatic retry max count for workflow action is 3 in default. </description> </property> - + <property> <name>oozie.service.LiteWorkflowStoreService.user.retry.inteval</name> <value>10</value> http://git-wip-us.apache.org/repos/asf/oozie/blob/d1caebb5/core/src/test/java/org/apache/oozie/command/TestXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/TestXCommand.java b/core/src/test/java/org/apache/oozie/command/TestXCommand.java index c32f816..e717f93 100644 --- a/core/src/test/java/org/apache/oozie/command/TestXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/TestXCommand.java @@ -65,6 +65,12 @@ public class TestXCommand extends XTestCase { } @Override + protected long getRequeueDelay() { + assertEquals(10 * 1000L, super.getRequeueDelay()); + return 100; + } + + @Override protected boolean isLockRequired() { return lockRequired; } http://git-wip-us.apache.org/repos/asf/oozie/blob/d1caebb5/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 6b082e6..d3e52d1 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.2.0 release (trunk - unreleased) +OOZIE-1428 The delay time for requeue should be configurable (sree2k via rkanter) OOZIE-1830 Change hadoop-1 profile to use 1.2.1 (seoeun25 via rkanter) OOZIE-1677 Add Oozie servers to instrumentation info (rkanter) OOZIE-1968 Building modules independently (shwethags)
