AmatyaAvadhanula commented on code in PR #12404:
URL: https://github.com/apache/druid/pull/12404#discussion_r897970461
##########
core/src/main/java/org/apache/druid/metadata/MetadataStorageActionHandler.java:
##########
@@ -99,6 +103,54 @@ List<TaskInfo<EntryType, StatusType>> getTaskInfos(
@Nullable String datasource
);
+ /**
+ * This is the recommended method to fetch Tasks for the task view
+ * This utilizes the new type and group_id columns and should be utilized
after migration
+ * Returns a list of TaskInfo for the tasks corresponding to the given
filters
+ * The TaskInfo comprises the TaskMetadata which is significantly smaller
than a Task, and the TaskStatus
+ * These are sufficient to create the TaskStatusPlus for a given Task, and
prevent unnecessary memory usage
+ *
+ * If {@code taskLookups} includes {@link TaskLookupType#ACTIVE}, it returns
all active tasks in the metadata store.
+ * If {@code taskLookups} includes {@link TaskLookupType#COMPLETE}, it
returns all complete tasks in the metadata
+ * store. For complete tasks, additional filters in {@code
CompleteTaskLookup} can be applied.
+ * All lookups should be processed atomically if more than one lookup is
given.
+ *
+ * fetchPayload determines the query used to fetch from the tasks table
+ * If true, fetch the payload and deserialize it to obtain the above fields
+ * Else, use the newly created type and group_id columns in the query for
task summaries
+ *
+ * @param taskLookups task lookup type and filters.
+ * @param datasource datasource filter
+ */
+ List<TaskInfo<TaskMetadata, StatusType>> getTaskMetadataInfos(
+ Map<TaskLookupType, TaskLookup> taskLookups,
+ @Nullable String datasource
+ );
+
+ /**
+ * Please use this method to fetch task for viewing on ingestion tab only
before task migration
+ * This deserializes the payload column to get the required fields, and has
a greater overhead
+ * Returns a list of TaskInfo for the tasks corresponding to the given
filters
+ * The TaskInfo comprises the TaskMetadata which is significantly smaller
than a Task, and the TaskStatus
+ * These are sufficient to create the TaskStatusPlus for a given Task, and
prevent unnecessary memory usage
+ *
+ * If {@code taskLookups} includes {@link TaskLookupType#ACTIVE}, it returns
all active tasks in the metadata store.
+ * If {@code taskLookups} includes {@link TaskLookupType#COMPLETE}, it
returns all complete tasks in the metadata
+ * store. For complete tasks, additional filters in {@code
CompleteTaskLookup} can be applied.
+ * All lookups should be processed atomically if more than one lookup is
given.
+ *
+ * fetchPayload determines the query used to fetch from the tasks table
+ * If true, fetch the payload and deserialize it to obtain the above fields
+ * Else, use the newly created type and group_id columns in the query for
task summaries
Review Comment:
Thanks for the suggestion. Has been applied
--
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]