narendly commented on a change in pull request #497: Fix job purge logic for 
job without config
URL: https://github.com/apache/helix/pull/497#discussion_r331846479
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/task/TaskUtil.java
 ##########
 @@ -717,41 +717,40 @@ protected static boolean removeJobsFromWorkflow(final 
HelixDataAccessor dataAcce
   }
 
   /**
-   * Return all jobs that are COMPLETED and passes its expiry time.
+   * Update all jobs that are COMPLETED and passes its expiry time and the 
jobs that are missing
+   * config.
    * @param dataAccessor
    * @param propertyStore
    * @param workflowConfig
    * @param workflowContext
-   * @return
+   * @param expiredJobs
+   * @param jobsWithoutConfig
    */
-  protected static Set<String> getExpiredJobs(HelixDataAccessor dataAccessor,
+  protected static void getExpiredJobs(HelixDataAccessor dataAccessor,
       HelixPropertyStore<ZNRecord> propertyStore, WorkflowConfig 
workflowConfig,
-      WorkflowContext workflowContext) {
-    Set<String> expiredJobs = new HashSet<>();
+      WorkflowContext workflowContext, Set<String> expiredJobs, Set<String> 
jobsWithoutConfig) {
 
     if (workflowContext != null) {
       Map<String, TaskState> jobStates = workflowContext.getJobStates();
       for (String job : workflowConfig.getJobDag().getAllNodes()) {
         JobConfig jobConfig = TaskUtil.getJobConfig(dataAccessor, job);
         JobContext jobContext = TaskUtil.getJobContext(propertyStore, job);
-        if (jobConfig == null) {
+        if (jobConfig != null) {
 
 Review comment:
   Nit: tip: If I were you I would keep the order of the if conditions the 
same. That way it's easier to review code with less diff. What I mean is, you 
could have kept `if (jobConfig == null) { `...

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to