alirezazamani commented on a change in pull request #1439:
URL: https://github.com/apache/helix/pull/1439#discussion_r504190399
##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -526,6 +533,185 @@ public void enqueueJobs(final String queue, final
List<String> jobs,
}
}
+ /**
+ * Add task to a running (IN-PROGRESS) job or a job which has not started
yet. Timeout for this
+ * operation is the default timeout which is 5 minutes. {@link
TaskDriver#DEFAULT_TIMEOUT}
+ * Note1: Task cannot be added if the job is in an illegal state. A job can
accept
+ * new task if the job is in-progress or it has not started yet.
+ * Note2: The job can only be added to non-targeted jobs.
+ * Note3: The taskID for the new task should be unique. If not, this API
throws an exception.
+ * Note4: In case of timeout exception, it is the user's responsibility to
check whether the task
+ * has been successfully added or not.
+ * @param workflowName
+ * @param jobName
+ * @param taskConfig
+ * @throws Exception if there is an issue with the request or the operation.
1-
+ * IllegalArgumentException will be thrown if the inputs are
invalid. 2- HelixException
+ * will be thrown if the job is not in the states to accept a new
task or if there is
+ * any issue in updating jobConfig. 3- TimeoutException will be
thrown if the outcome of
+ * the task addition is unknown and cannot be verified.
+ */
+ public void addTask(String workflowName, String jobName, TaskConfig
taskConfig) throws Exception {
+ addTask(workflowName, jobName, taskConfig, DEFAULT_TIMEOUT);
+ }
+
+ /**
+ * Add task to a running (IN-PROGRESS) job or a job which has not started yet
+ * Note1: Task cannot be added if the job is in an illegal state. A job can
accept
+ * new task if the job is in-progress or it has not started yet.
+ * Note2: The job can only be added to non-targeted jobs.
+ * Note3: The taskID for the new task should be unique. If not, this API
throws an exception.
+ * Note4: In case of timeout exception, it is the user's responsibility to
check whether the task
+ * has been successfully added or not.
+ * Note5: timeout is the time that this API checks whether the task has been
successfully added or
+ * not.
+ * @param workflowName
+ * @param jobName
+ * @param taskConfig
+ * @param timeoutMs
+ * @throws Exception if there is an issue with the request or the operation.
1-
Review comment:
Done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]