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


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:
##########
@@ -533,15 +532,20 @@ public boolean isReady(TaskActionClient taskActionClient) 
throws Exception
     return true;
   }
 
-  private TaskLockType determineLockType(boolean useConcurrentLocks)
+  public TaskLockType determineLockType()
   {
-    TaskLockType actualLockType;
+    final boolean useConcurrentLocks = Boolean.TRUE.equals(
+        getContextValue(
+            Tasks.USE_CONCURRENT_LOCKS,
+            Tasks.DEFAULT_USE_CONCURRENT_LOCKS
+        )
+    );
+
     if (useConcurrentLocks) {
-      actualLockType = TaskLockType.REPLACE;
+      return TaskLockType.REPLACE;
     } else {
-      actualLockType = getContextValue(Tasks.TASK_LOCK_TYPE, 
TaskLockType.EXCLUSIVE);
+      return getContextValue(Tasks.TASK_LOCK_TYPE, TaskLockType.EXCLUSIVE);

Review Comment:
   fixed.



##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:
##########
@@ -533,15 +532,20 @@ public boolean isReady(TaskActionClient taskActionClient) 
throws Exception
     return true;
   }
 
-  private TaskLockType determineLockType(boolean useConcurrentLocks)
+  public TaskLockType determineLockType()
   {
-    TaskLockType actualLockType;
+    final boolean useConcurrentLocks = Boolean.TRUE.equals(

Review Comment:
   fixed, using the new utility method in `TaskLocks`.



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