Skip to content

Commit 64023d7

Browse files
authored
ESQL: Expand javadoc on NodeInfo (#132665)
1 parent 66107f1 commit 64023d7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/tree/Node.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,11 @@ protected final <E> T transformNodeProps(Class<E> typeToken, Function<? super E,
307307
}
308308

309309
/**
310-
* Return the information about this node.
311-
* <p>
312310
* Normally, you want to use one of the static {@code create} methods to implement this.
313311
* <p>
314312
* For {@code QueryPlan}s, it is very important that
315313
* the properties contain all of the expressions and references relevant to this node, and
316-
* that all of the properties are used in the provided constructor; otherwise query plan
314+
* that all the properties are used in the provided constructor; otherwise query plan
317315
* transformations like
318316
* {@code QueryPlan#transformExpressionsOnly(Function)}
319317
* will not have an effect.

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/tree/NodeInfo.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
import static java.util.Collections.unmodifiableList;
1717

1818
/**
19-
* Information about a {@link Node}.
19+
* All the information about a {@link Node} that is needed to recreate or modify it.
20+
* <p>
21+
* Generally, this will contain the longest constructor of the respective {@link Node} subclass; the non-{@link Source} arguments of that
22+
* constructor are called "properties" of the node and are modified when transforming the node.
23+
* <p>
24+
* This allows us to perform traversals and transformations of query plans and expressions without resorting to reflection, e.g. via
25+
* {@link Node#transformNodeProps(Class, Function)}, which is used e.g. in {@code QueryPlan#transformExpressionsDown}.
2026
* <p>
2127
* All the uses of this are fairly non-OO and we're looking
2228
* for ways to use this less and less.

0 commit comments

Comments
 (0)