Forráskód Böngészése

Fixes cat tasks operation in detailed mode

Currently the cat tasks operation fails in the detailed mode.

Closes #19755
Igor Motov 9 éve
szülő
commit
22e63b4783

+ 2 - 2
core/src/main/java/org/elasticsearch/rest/action/cat/RestTasksAction.java

@@ -98,7 +98,7 @@ public class RestTasksAction extends AbstractCatAction {
 
         // Task detailed info
         if (detailed) {
-            table.addCell("description", "default:false;alias:desc;desc:task action");
+            table.addCell("description", "default:true;alias:desc;desc:task action");
         }
         table.endHeaders();
         return table;
@@ -142,7 +142,7 @@ public class RestTasksAction extends AbstractCatAction {
         table.endRow();
     }
 
-    private void buildGroups(Table table, boolean detailed, boolean fullId, List<TaskGroup> taskGroups) {
+    private void buildGroups(Table table, boolean fullId, boolean detailed, List<TaskGroup> taskGroups) {
         DiscoveryNodes discoveryNodes = clusterService.state().nodes();
         List<TaskGroup> sortedGroups = new ArrayList<>(taskGroups);
         sortedGroups.sort((o1, o2) -> Long.compare(o1.getTaskInfo().getStartTime(), o2.getTaskInfo().getStartTime()));

+ 10 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/cat.tasks/10_basic.yaml

@@ -7,4 +7,13 @@
   - match:
       $body: |
                / # action  task_id      parent_task_id      type    start_time   timestamp            running_time  ip                                  node
-               ^(  \S+\s+  \S+\:\d+\s+  (?:\-|\S+\:\d+)\s+  \S+\s+  \d+\s+       \d\d\:\d\d\:\d\d\s+  \S+\s+        \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+  \S+(?:\s\S+)*\n)+$/
+               ^(  \S+\s+  \S+\:\d+\s+  (?:\-|\S+\:\d+)\s+  \S+\s+  \d+\s+       \d\d\:\d\d\:\d\d\s+  \S+\s+        \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+  \S+\n)+$/
+
+  - do:
+      cat.tasks:
+       detailed: true
+
+  - match:
+      $body: |
+               / # action  task_id      parent_task_id      type    start_time   timestamp            running_time  ip                                  node   description
+               ^(  \S+\s+  \S+\:\d+\s+  (?:\-|\S+\:\d+)\s+  \S+\s+  \d+\s+       \d\d\:\d\d\:\d\d\s+  \S+\s+        \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s+  \S+\s+ .*\n)+$/