LakshSingla commented on code in PR #14446:
URL: https://github.com/apache/druid/pull/14446#discussion_r1243504781
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -88,13 +88,22 @@ public void run() throws Exception
.map(TaskRunnerWorkItem::getTaskId)
.map(DurableStorageUtils::getControllerDirectory)
.collect(Collectors.toSet());
+ Set<String> knownTaskIds = taskRunner.getKnownTasks()
+ .stream()
+ .map(TaskRunnerWorkItem::getTaskId)
+
.map(DurableStorageUtils::getControllerDirectory)
+ .collect(Collectors.toSet());
Set<String> filesToRemove = new HashSet<>();
while (allFiles.hasNext()) {
String currentFile = allFiles.next();
- String taskIdFromPathOrEmpty =
DurableStorageUtils.getControllerTaskIdWithPrefixFromPath(currentFile);
- if (taskIdFromPathOrEmpty != null && !taskIdFromPathOrEmpty.isEmpty()) {
- if (runningTaskIds.contains(taskIdFromPathOrEmpty)) {
+ String nextDirName =
DurableStorageUtils.getNextDirNameWithPrefixFromPath(currentFile);
+ if (nextDirName != null && !nextDirName.isEmpty()) {
+ if (runningTaskIds.contains(nextDirName)) {
+ // do nothing
+ } else if (DurableStorageUtils.QUERY_RESULTS_DIR.equals(nextDirName)
Review Comment:
I see your point! Just revisited the Javadocs for `listDir`. This LGTM,
thanks for clarfying
--
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]