Skip to content

Commit 6c4f3f3

Browse files
committed
fix merge
1 parent f723d6c commit 6c4f3f3

File tree

7 files changed

+52
-40
lines changed

7 files changed

+52
-40
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverProfile.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class DriverProfile implements Writeable, ChunkedToXContentObject {
3232
* short and meaningful as a grouping identifier. We use the phase of the
3333
* query right now: "data", "node_reduce", "final".
3434
*/
35-
private final String taskDescription;
35+
private final String description;
3636

3737
/**
3838
* Millis since epoch when the driver started.
@@ -69,7 +69,7 @@ public class DriverProfile implements Writeable, ChunkedToXContentObject {
6969
private final DriverSleeps sleeps;
7070

7171
public DriverProfile(
72-
String taskDescription,
72+
String description,
7373
long startMillis,
7474
long stopMillis,
7575
long tookNanos,
@@ -78,7 +78,7 @@ public DriverProfile(
7878
List<DriverStatus.OperatorStatus> operators,
7979
DriverSleeps sleeps
8080
) {
81-
this.taskDescription = taskDescription;
81+
this.description = description;
8282
this.startMillis = startMillis;
8383
this.stopMillis = stopMillis;
8484
this.tookNanos = tookNanos;
@@ -89,7 +89,7 @@ public DriverProfile(
8989
}
9090

9191
public DriverProfile(StreamInput in) throws IOException {
92-
this.taskDescription = in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90) ? in.readString() : "";
92+
this.description = in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90) ? in.readString() : "";
9393
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_16_0)) {
9494
this.startMillis = in.readVLong();
9595
this.stopMillis = in.readVLong();
@@ -113,7 +113,7 @@ public DriverProfile(StreamInput in) throws IOException {
113113
@Override
114114
public void writeTo(StreamOutput out) throws IOException {
115115
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90)) {
116-
out.writeString(taskDescription);
116+
out.writeString(description);
117117
}
118118
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_0)) {
119119
out.writeVLong(startMillis);
@@ -131,8 +131,8 @@ public void writeTo(StreamOutput out) throws IOException {
131131
/**
132132
* Description of the task this driver is running.
133133
*/
134-
public String taskDescription() {
135-
return taskDescription;
134+
public String description() {
135+
return description;
136136
}
137137

138138
/**
@@ -189,7 +189,7 @@ public DriverSleeps sleeps() {
189189
@Override
190190
public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params) {
191191
return Iterators.concat(ChunkedToXContentHelper.startObject(), Iterators.single((b, p) -> {
192-
b.field("task_description", taskDescription);
192+
b.field("description", description);
193193
b.timestampFieldsFromUnixEpochMillis("start_millis", "start", startMillis);
194194
b.timestampFieldsFromUnixEpochMillis("stop_millis", "stop", stopMillis);
195195
b.field("took_nanos", tookNanos);
@@ -218,7 +218,7 @@ public boolean equals(Object o) {
218218
return false;
219219
}
220220
DriverProfile that = (DriverProfile) o;
221-
return taskDescription.equals(that.taskDescription)
221+
return description.equals(that.description)
222222
&& startMillis == that.startMillis
223223
&& stopMillis == that.stopMillis
224224
&& tookNanos == that.tookNanos
@@ -230,7 +230,7 @@ public boolean equals(Object o) {
230230

231231
@Override
232232
public int hashCode() {
233-
return Objects.hash(taskDescription, startMillis, stopMillis, tookNanos, cpuNanos, iterations, operators, sleeps);
233+
return Objects.hash(description, startMillis, stopMillis, tookNanos, cpuNanos, iterations, operators, sleeps);
234234
}
235235

236236
@Override

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverStatus.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class DriverStatus implements Task.Status {
4545
/**
4646
* Description of the task this driver is running.
4747
*/
48-
private final String taskDescription;
48+
private final String description;
4949

5050
/**
5151
* Milliseconds since epoch when this driver started.
@@ -88,7 +88,7 @@ public class DriverStatus implements Task.Status {
8888

8989
DriverStatus(
9090
String sessionId,
91-
String taskDescription,
91+
String description,
9292
long started,
9393
long lastUpdated,
9494
long cpuTime,
@@ -99,7 +99,7 @@ public class DriverStatus implements Task.Status {
9999
DriverSleeps sleeps
100100
) {
101101
this.sessionId = sessionId;
102-
this.taskDescription = taskDescription;
102+
this.description = description;
103103
this.started = started;
104104
this.lastUpdated = lastUpdated;
105105
this.cpuNanos = cpuTime;
@@ -112,7 +112,7 @@ public class DriverStatus implements Task.Status {
112112

113113
public DriverStatus(StreamInput in) throws IOException {
114114
this.sessionId = in.readString();
115-
this.taskDescription = in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90) ? in.readString() : "";
115+
this.description = in.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90) ? in.readString() : "";
116116
this.started = in.getTransportVersion().onOrAfter(TransportVersions.V_8_14_0) ? in.readLong() : 0;
117117
this.lastUpdated = in.readLong();
118118
this.cpuNanos = in.getTransportVersion().onOrAfter(TransportVersions.V_8_14_0) ? in.readVLong() : 0;
@@ -131,7 +131,7 @@ public DriverStatus(StreamInput in) throws IOException {
131131
public void writeTo(StreamOutput out) throws IOException {
132132
out.writeString(sessionId);
133133
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_DRIVER_TASK_DESCRIPTION_90)) {
134-
out.writeString(taskDescription);
134+
out.writeString(description);
135135
}
136136
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_14_0)) {
137137
out.writeLong(started);
@@ -166,8 +166,8 @@ public String sessionId() {
166166
* short and meaningful as a grouping identifier. We use the phase of the
167167
* query right now: "data", "node_reduce", "final".
168168
*/
169-
public String taskDescription() {
170-
return taskDescription;
169+
public String description() {
170+
return description;
171171
}
172172

173173
/**
@@ -232,7 +232,7 @@ public List<OperatorStatus> activeOperators() {
232232
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
233233
builder.startObject();
234234
builder.field("session_id", sessionId);
235-
builder.field("task_description", taskDescription);
235+
builder.field("description", description);
236236
builder.field("started", DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.formatMillis(started));
237237
builder.field("last_updated", DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.formatMillis(lastUpdated));
238238
builder.field("cpu_nanos", cpuNanos);
@@ -261,7 +261,7 @@ public boolean equals(Object o) {
261261
if (o == null || getClass() != o.getClass()) return false;
262262
DriverStatus that = (DriverStatus) o;
263263
return sessionId.equals(that.sessionId)
264-
&& taskDescription.equals(that.taskDescription)
264+
&& description.equals(that.description)
265265
&& started == that.started
266266
&& lastUpdated == that.lastUpdated
267267
&& cpuNanos == that.cpuNanos
@@ -276,7 +276,7 @@ public boolean equals(Object o) {
276276
public int hashCode() {
277277
return Objects.hash(
278278
sessionId,
279-
taskDescription,
279+
description,
280280
started,
281281
lastUpdated,
282282
cpuNanos,

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/LuceneSourceOperatorTests.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.compute.data.ElementType;
2323
import org.elasticsearch.compute.data.LongBlock;
2424
import org.elasticsearch.compute.data.Page;
25+
import org.elasticsearch.compute.operator.Driver;
2526
import org.elasticsearch.compute.operator.DriverContext;
2627
import org.elasticsearch.compute.operator.Operator;
2728
import org.elasticsearch.compute.operator.PageConsumerOperator;
@@ -32,6 +33,7 @@
3233
import org.elasticsearch.compute.test.TestDriverFactory;
3334
import org.elasticsearch.compute.test.TestResultPageSinkOperator;
3435
import org.elasticsearch.core.IOUtils;
36+
import org.elasticsearch.core.TimeValue;
3537
import org.elasticsearch.index.cache.query.TrivialQueryCachingPolicy;
3638
import org.elasticsearch.index.mapper.MappedFieldType;
3739
import org.elasticsearch.index.mapper.NumberFieldMapper;
@@ -144,7 +146,19 @@ public void testEarlyTermination() {
144146
receivedRows.addAndGet(p.getPositionCount());
145147
p.releaseBlocks();
146148
});
147-
Driver driver = new Driver("driver" + i, driverContext, sourceOperator, List.of(), sinkOperator, () -> {});
149+
Driver driver = new Driver(
150+
"driver" + i,
151+
"test",
152+
0,
153+
0,
154+
driverContext,
155+
() -> "test",
156+
sourceOperator,
157+
List.of(),
158+
sinkOperator,
159+
TimeValue.timeValueNanos(1),
160+
() -> {}
161+
);
148162
drivers.add(driver);
149163
}
150164
OperatorTestCase.runDriver(drivers);

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/DriverProfileTests.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,7 @@ protected DriverProfile mutateInstance(DriverProfile instance) throws IOExceptio
135135
case 7 -> sleeps = randomValueOtherThan(sleeps, DriverSleepsTests::randomDriverSleeps);
136136
default -> throw new UnsupportedOperationException();
137137
}
138-
return new DriverProfile(
139-
shortDescription,
140-
startMillis,
141-
stopMillis,
142-
tookNanos,
143-
cpuNanos,
144-
iterations,
145-
operators,
146-
sleeps
147-
);
138+
return new DriverProfile(shortDescription, startMillis, stopMillis, tookNanos, cpuNanos, iterations, operators, sleeps);
148139
}
149140

150141
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/LimitOperatorTests.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.compute.test.OperatorTestCase;
1414
import org.elasticsearch.compute.test.RandomBlock;
1515
import org.elasticsearch.compute.test.SequenceLongBlockSourceOperator;
16+
import org.elasticsearch.core.TimeValue;
1617
import org.hamcrest.Matcher;
1718

1819
import java.util.ArrayList;
@@ -164,7 +165,19 @@ public void close() {
164165
p.releaseBlocks();
165166
});
166167
drivers.add(
167-
new Driver("driver" + i, driverContext, sourceOperator, List.of(limitFactory.get(driverContext)), sinkOperator, () -> {})
168+
new Driver(
169+
"unset",
170+
"test",
171+
0,
172+
0,
173+
driverContext,
174+
() -> "test",
175+
sourceOperator,
176+
List.of(limitFactory.get(driverContext)),
177+
sinkOperator,
178+
TimeValue.timeValueMillis(1),
179+
() -> {}
180+
)
168181
);
169182
}
170183
runDriver(drivers);

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionTaskIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.compute.lucene.LuceneSourceOperator;
2222
import org.elasticsearch.compute.lucene.ValuesSourceReaderOperator;
2323
import org.elasticsearch.compute.operator.DriverStatus;
24+
import org.elasticsearch.compute.operator.DriverStatus.OperatorStatus;
2425
import org.elasticsearch.compute.operator.DriverTaskRunner;
2526
import org.elasticsearch.compute.operator.exchange.ExchangeService;
2627
import org.elasticsearch.compute.operator.exchange.ExchangeSinkHandler;

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,7 @@ public LocalExecutionPlan plan(String description, FoldContext foldCtx, Physical
190190
final TimeValue statusInterval = configuration.pragmas().statusInterval();
191191
context.addDriverFactory(
192192
new DriverFactory(
193-
new DriverSupplier(
194-
description,
195-
context.bigArrays,
196-
context.blockFactory,
197-
physicalOperation,
198-
statusInterval,
199-
settings
200-
),
193+
new DriverSupplier(description, context.bigArrays, context.blockFactory, physicalOperation, statusInterval, settings),
201194
context.driverParallelism().get()
202195
)
203196
);

0 commit comments

Comments
 (0)