Open humit0 opened 3 years ago
The original PR(#5801) that introduced the parameter 'createdTimeInterval' took the interval parameter as duration.
From the user's side, I think 'interval' is the right semantic rather than duration because that would help us find out right tasks in given time range.
cc @jihoonson
Affected Version
0.21.1
Description
(docs)[https://druid.apache.org/docs/0.21.1/operations/api-reference.html#get-14]
From the documentation,
/druid/indexer/v1/tasks
API acceptcreatedTimeInterval
parameter.If I call API without
createdTimeInterval
parameter, I can retrieve 1 task which createdTime is2021-08-12T23:51:23.151Z
.The createdTime of this task was
2021-08-12T23:51:23.151Z
, socreatedTimeInterval
"2021-08-12T23:50:00.000Z_2021-08-13T00:00:00.000Z" should contain this task. But I retrieve empty task.But when I specify
createdTimeInterval
"2021-01-01T00:00:00.000Z_2021-01-02T00:00:10.000Z", I can retrieve 1 task which createdTime was2021-08-12T23:51:23.151Z
Search from code
When call task API with
createdTimeInterval
parameter, below code execute. It calculate time duration from time interval. https://github.com/apache/druid/blob/druid-0.21.1/indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java#L616And
getCompletedTaskInfoByCreatedTimeDuration
callgetRecentlyCreatedAlreadyFinishedTaskInfo
method.https://github.com/apache/druid/blob/druid-0.21.1/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskStorageQueryAdapter.java#L61
getRecentlyCreatedAlreadyFinishedTaskInfo
method is coping completed task list which createdTime is (now - duration) ~ (now). https://github.com/apache/druid/blob/druid-0.21.1/indexing-service/src/main/java/org/apache/druid/indexing/overlord/MetadataTaskStorage.java#L223So I think create
getCompletedTaskInfoByCreatedTimeInterval
method fromTaskStorageQueryAdapter
class which arguments aremaxTaskStatuses
,interval
, anddataSource
.