This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new ada3ae0 Retain order in TaskReport. (#12005)
ada3ae0 is described below
commit ada3ae08dfc432f34e4ef1ec87f9800c91ba2c54
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Mar 4 08:06:20 2022 -0800
Retain order in TaskReport. (#12005)
---
.../main/java/org/apache/druid/indexing/common/TaskReport.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/indexing-service/src/main/java/org/apache/druid/indexing/common/TaskReport.java
b/indexing-service/src/main/java/org/apache/druid/indexing/common/TaskReport.java
index 3cee6f2..5e2f5b6 100644
---
a/indexing-service/src/main/java/org/apache/druid/indexing/common/TaskReport.java
+++
b/indexing-service/src/main/java/org/apache/druid/indexing/common/TaskReport.java
@@ -22,7 +22,7 @@ package org.apache.druid.indexing.common;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -44,9 +44,13 @@ public interface TaskReport
*/
Object getPayload();
+ /**
+ * Returns an order-preserving map that is suitable for passing into {@link
TaskReportFileWriter#write}.
+ */
static Map<String, TaskReport> buildTaskReports(TaskReport... taskReports)
{
- Map<String, TaskReport> taskReportMap = new HashMap<>();
+ // Use LinkedHashMap to preserve order of the reports.
+ Map<String, TaskReport> taskReportMap = new LinkedHashMap<>();
for (TaskReport taskReport : taskReports) {
taskReportMap.put(taskReport.getReportKey(), taskReport);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]