This is an automated email from the ASF dual-hosted git repository. hulee pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/helix.git
commit 870cf7cd824efbcd6e01a975e7f5bf6b5c6470d8 Author: Hunter Lee <[email protected]> AuthorDate: Tue Apr 2 14:17:23 2019 -0700 TASK: Fix cleanupQueue() API This API is meant for JobQueues only. However, it was checking only using isTerminable(), which is a deprecated flag for whether a workflow is a queue or not. Changelist: 1. Add isJobQueue() check in cleanupQueue() in TaskDriver RB=1616870 G=helix-reviewers A=jxue Signed-off-by: Hunter Lee <[email protected]> --- helix-core/src/main/java/org/apache/helix/task/TaskDriver.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java index f31c68b..c8921d8 100644 --- a/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java +++ b/helix-core/src/main/java/org/apache/helix/task/TaskDriver.java @@ -517,7 +517,6 @@ public class TaskDriver { /** * Remove all jobs that are in final states (ABORTED, FAILED, COMPLETED) from the job queue. The * job config, job context will be removed from Zookeeper. - * * @param queue The name of job queue */ public void cleanupQueue(String queue) { @@ -527,8 +526,7 @@ public class TaskDriver { throw new IllegalArgumentException("Queue " + queue + " does not yet exist!"); } - boolean isTerminable = workflowConfig.isTerminable(); - if (isTerminable) { + if (!workflowConfig.isJobQueue() || workflowConfig.isTerminable()) { throw new IllegalArgumentException(queue + " is not a queue!"); }
