Skip to content

Commit 1d95cbc

Browse files
committed
Add operators to constants, rename
1 parent af2b5ee commit 1d95cbc

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlGetQueryAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class EsqlGetQueryAction extends ActionType<EsqlGetQueryResponse> {
1414
public static final EsqlGetQueryAction INSTANCE = new EsqlGetQueryAction();
15-
public static final String NAME = "cluster:monitor/data/read/esql/query";
15+
public static final String NAME = "cluster:monitor/xpack/esql/get_queries";
1616

1717
private EsqlGetQueryAction() {
1818
super(NAME);

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlListQueriesAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class EsqlListQueriesAction extends ActionType<EsqlListQueriesResponse> {
1414
public static final EsqlListQueriesAction INSTANCE = new EsqlListQueriesAction();
15-
public static final String NAME = "cluster:monitor/data/read/esql/queries";
15+
public static final String NAME = "cluster:monitor/xpack/esql/list_queries";
1616

1717
private EsqlListQueriesAction() {
1818
super(NAME);

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlGetQueryAction.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,7 @@ public void onResponse(GetTaskResponse response) {
4545
.execute(new ActionListener<>() {
4646
@Override
4747
public void onResponse(ListTasksResponse response) {
48-
listener.onResponse(
49-
new EsqlGetQueryResponse(
50-
new EsqlGetQueryResponse.DetailedQuery(
51-
request.id(),
52-
task.startTime(),
53-
task.runningTimeNanos(),
54-
task.description(),
55-
// FIXME(gal, NOCOMMIT) This should be the coordinating node... how do I get that?
56-
task.node(),
57-
response.getTasks().stream().map(TaskInfo::node).distinct().toList()
58-
)
59-
)
60-
);
48+
listener.onResponse(new EsqlGetQueryResponse(toDetailedQuery(task, response)));
6149
}
6250

6351
@Override
@@ -73,4 +61,15 @@ public void onFailure(Exception e) {
7361
}
7462
});
7563
}
64+
65+
private static EsqlGetQueryResponse.DetailedQuery toDetailedQuery(TaskInfo task, ListTasksResponse response) {
66+
return new EsqlGetQueryResponse.DetailedQuery(
67+
task.taskId(),
68+
task.startTime(),
69+
task.runningTimeNanos(),
70+
task.description(), // Query
71+
task.node(), // Coordinating node
72+
response.getTasks().stream().map(TaskInfo::node).distinct().toList() // Data nodes
73+
);
74+
}
7675
}

x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ public class Constants {
386386
"cluster:monitor/xpack/enrich/coordinator_stats",
387387
"cluster:monitor/xpack/enrich/stats",
388388
"cluster:monitor/xpack/eql/stats/dist",
389+
"cluster:monitor/xpack/esql/get_queries",
390+
"cluster:monitor/xpack/esql/list_queries",
389391
"cluster:monitor/xpack/esql/stats/dist",
390392
"cluster:monitor/xpack/inference/post",
391393
"cluster:monitor/xpack/inference/get",

0 commit comments

Comments
 (0)