-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Introduce execution location marker for better handling of remote/local compatibility #132205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2c051b5
170d83c
411a2ed
ae7a7ce
9e4be57
37600f0
f7f5e9b
841a22e
acb933c
0535258
e67924c
8413dbc
997b9bd
61fe122
e00abb5
6ff5827
2e2f953
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.esql.plan.logical; | ||
|
||
/** | ||
* Mark nodes that execute only in a specific way, either on the coordinator or on a remote node. | ||
*/ | ||
public interface ExecutesOn { | ||
enum ExecuteLocation { | ||
COORDINATOR, | ||
REMOTE, | ||
ANY; // Can be executed on either coordinator or remote nodes | ||
} | ||
|
||
ExecuteLocation executesOn(); | ||
|
||
/** | ||
* Executes on the remote nodes only (note that may include coordinator, but not on the aggregation stage). | ||
*/ | ||
interface Remote extends ExecutesOn { | ||
@Override | ||
default ExecuteLocation executesOn() { | ||
return ExecuteLocation.REMOTE; | ||
} | ||
} | ||
|
||
/** | ||
* Executes on the coordinator only. Can not be run on remote nodes. | ||
*/ | ||
interface Coordinator extends ExecutesOn { | ||
@Override | ||
default ExecuteLocation executesOn() { | ||
return ExecuteLocation.COORDINATOR; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,12 @@ | |
* A Fork is a n-ary {@code Plan} where each child is a sub plan, e.g. | ||
* {@code FORK [WHERE content:"fox" ] [WHERE content:"dog"] } | ||
*/ | ||
public class Fork extends LogicalPlan implements PostAnalysisPlanVerificationAware, TelemetryAware, PipelineBreaker { | ||
public class Fork extends LogicalPlan | ||
implements | ||
PostAnalysisPlanVerificationAware, | ||
TelemetryAware, | ||
PipelineBreaker, | ||
|
||
ExecutesOn.Coordinator { | ||
|
||
public static final String FORK_FIELD = "_fork"; | ||
public static final int MAX_BRANCHES = 8; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: Hmm, maybe PipelineBreaker should inherit from ExecutesOn.Coordinator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure yet... Need to think about it a bit more to have a good answer for this.