AmatyaAvadhanula commented on code in PR #15039:
URL: https://github.com/apache/druid/pull/15039#discussion_r1356656086
##########
server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java:
##########
@@ -247,32 +248,29 @@ private boolean cancelTaskIfGranularityChanged(
/**
* Gets a List of Intervals locked by higher priority tasks for each
datasource.
+ * However, when using a REPLACE lock for compaction, intervals locked with
any APPEND lock will not be returned
* Since compaction tasks submitted for these Intervals would have to wait
anyway,
* we skip these Intervals until the next compaction run.
* <p>
* For now, Segment Locks are being treated the same as Time Chunk Locks even
* though they lock only a Segment and not the entire Interval. Thus,
* a compaction task will not be submitted for an Interval if
* <ul>
- * <li>either the whole Interval is locked by a higher priority Task</li>
+ * <li>either the whole Interval is locked by a higher priority Task with
an incompatible lock type</li>
* <li>or there is atleast one Segment in the Interval that is locked by a
* higher priority Task</li>
* </ul>
*/
- private Map<String, List<Interval>> getLockedIntervalsToSkip(
+ private Map<String, List<Interval>> getLockedIntervalsV2(
List<DataSourceCompactionConfig> compactionConfigs
)
{
- final Map<String, Integer> minTaskPriority = compactionConfigs
+ final List<LockFilterPolicy> lockFilterPolicies = compactionConfigs
.stream()
- .collect(
- Collectors.toMap(
- DataSourceCompactionConfig::getDataSource,
- DataSourceCompactionConfig::getTaskPriority
- )
- );
+ .map(config -> new LockFilterPolicy(config.getDataSource(),
config.getTaskPriority(), config.getTaskContext()))
Review Comment:
Tasks.TASK_LOCK_TYPE, TaskLockType etc are not available here.
Didn't want to hardcode the string passed as the key
--
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]