You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/07/27 21:07:36 UTC
[GitHub] [druid] jon-wei commented on a change in pull request #11501: Allow kill task to mark segments as unused
jon-wei commented on a change in pull request #11501:
URL: https://github.com/apache/druid/pull/11501#discussion_r677800795
##########
File path: server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
##########
@@ -226,6 +226,33 @@ public void start()
return matchingSegments;
}
+ @Override
+ public int markSegmentsAsUnusedWithinInterval(String dataSource, Interval interval)
+ {
+ int numSegmentsMarkedUnused = connector.retryTransaction(
+ (handle, status) -> {
+ return handle
+ .createStatement(
+ StringUtils.format(
+ "UPDATE %s SET used=false WHERE dataSource = :dataSource "
+ + "AND start >= :start AND %2$send%2$s <= :end",
Review comment:
Hm, I used the same query as run by the `markUnused` endpoint on the coordinator:
https://github.com/apache/druid/blob/master/server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataManager.java#L836
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org