kfaraz commented on code in PR #16316:
URL: https://github.com/apache/druid/pull/16316#discussion_r1574944260


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskLockbox.java:
##########
@@ -961,7 +961,12 @@ public Map<String, List<Interval>> 
getLockedIntervals(List<LockFilterPolicy> loc
 
             final int priority = lockFilter.getPriority();
             final boolean ignoreAppendLocks =
-                
TaskLockType.REPLACE.name().equals(lockFilter.getContext().get(Tasks.TASK_LOCK_TYPE));
+                Boolean.TRUE.equals(lockFilter.getContext().getOrDefault(
+                    Tasks.USE_CONCURRENT_LOCKS,
+                    Tasks.DEFAULT_USE_CONCURRENT_LOCKS))
+                || 
TaskLockType.REPLACE.name().equals(lockFilter.getContext().getOrDefault(
+                    Tasks.TASK_LOCK_TYPE,
+                    Tasks.DEFAULT_TASK_LOCK_TYPE));

Review Comment:
   Slightly reformatted for better readability since this condition has become 
a little difficult now.
   
   ```suggestion
                   Boolean.TRUE.equals(
                       lockFilter.getContext().getOrDefault(
                           Tasks.USE_CONCURRENT_LOCKS,
                           Tasks.DEFAULT_USE_CONCURRENT_LOCKS
                       )
                   )
                   || TaskLockType.REPLACE.name().equals(
                       lockFilter.getContext().getOrDefault(
                           Tasks.TASK_LOCK_TYPE,
                           Tasks.DEFAULT_TASK_LOCK_TYPE
                       )
                   );
   ```
   
   You may also consider breaking up the condition.
   
   ```java
   final boolean isUsingConcurrentLocks = condition1;
   final boolean isUsingReplaceLock = condition2;
   final boolean ignoreAppendLocks = isUsingConcurrentLocks || isReplaceLock;
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to