Skip to content

Commit c57e2d2

Browse files
Merge pull request ESQL-1371 from elastic/main
🤖 ESQL: Merge upstream
2 parents f3b2006 + ba97cb7 commit c57e2d2

File tree

31 files changed

+678
-9
lines changed

31 files changed

+678
-9
lines changed

server/src/main/java/org/elasticsearch/health/RestGetHealthAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.elasticsearch.client.internal.node.NodeClient;
1212
import org.elasticsearch.rest.BaseRestHandler;
1313
import org.elasticsearch.rest.RestRequest;
14+
import org.elasticsearch.rest.Scope;
15+
import org.elasticsearch.rest.ServerlessScope;
1416
import org.elasticsearch.rest.action.RestCancellableNodeClient;
1517
import org.elasticsearch.rest.action.RestChunkedToXContentListener;
1618

@@ -19,6 +21,7 @@
1921

2022
import static org.elasticsearch.rest.RestRequest.Method.GET;
2123

24+
@ServerlessScope(Scope.INTERNAL)
2225
public class RestGetHealthAction extends BaseRestHandler {
2326

2427
private static final String VERBOSE_PARAM = "verbose";

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java

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

3232
import static org.elasticsearch.rest.RestRequest.Method.GET;
3333

34-
@ServerlessScope(Scope.PUBLIC)
34+
@ServerlessScope(Scope.INTERNAL)
3535
public class RestClusterGetSettingsAction extends BaseRestHandler {
3636

3737
private final Settings settings;

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java

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

2626
import static org.elasticsearch.rest.RestRequest.Method.PUT;
2727

28-
@ServerlessScope(Scope.PUBLIC)
28+
@ServerlessScope(Scope.INTERNAL)
2929
public class RestClusterUpdateSettingsAction extends BaseRestHandler {
3030
private static final String PERSISTENT = "persistent";
3131
private static final String TRANSIENT = "transient";

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java

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

2222
import static org.elasticsearch.rest.RestRequest.Method.GET;
2323

24-
@ServerlessScope(Scope.PUBLIC)
24+
@ServerlessScope(Scope.INTERNAL)
2525
public class RestPendingClusterTasksAction extends BaseRestHandler {
2626

2727
@Override

server/src/main/java/org/elasticsearch/rest/action/cat/RestCatRecoveryAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import org.elasticsearch.indices.recovery.RecoveryState;
2424
import org.elasticsearch.rest.RestRequest;
2525
import org.elasticsearch.rest.RestResponse;
26+
import org.elasticsearch.rest.Scope;
27+
import org.elasticsearch.rest.ServerlessScope;
2628
import org.elasticsearch.rest.action.RestCancellableNodeClient;
2729
import org.elasticsearch.rest.action.RestResponseListener;
2830

@@ -38,6 +40,7 @@
3840
* in a string format, designed to be used at the command line. An Index can
3941
* be specified to limit output to a particular index or indices.
4042
*/
43+
@ServerlessScope(Scope.INTERNAL)
4144
public class RestCatRecoveryAction extends AbstractCatAction {
4245

4346
@Override

server/src/main/java/org/elasticsearch/rest/action/cat/RestHealthAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
import org.elasticsearch.common.Table;
1515
import org.elasticsearch.rest.RestRequest;
1616
import org.elasticsearch.rest.RestResponse;
17+
import org.elasticsearch.rest.Scope;
18+
import org.elasticsearch.rest.ServerlessScope;
1719
import org.elasticsearch.rest.action.RestResponseListener;
1820

1921
import java.util.List;
2022
import java.util.Locale;
2123

2224
import static org.elasticsearch.rest.RestRequest.Method.GET;
2325

26+
@ServerlessScope(Scope.INTERNAL)
2427
public class RestHealthAction extends AbstractCatAction {
2528

2629
@Override

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/ClusterHandle.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public interface ClusterHandle extends Closeable {
2929
*/
3030
void stop(boolean forcibly);
3131

32+
/**
33+
* Stops the node at a given index.
34+
* @param index of the node to stop
35+
*/
36+
void stopNode(int index);
37+
3238
/**
3339
* Restarts the cluster. Effectively the same as calling {@link #stop(boolean)} followed by {@link #start()}
3440
*
@@ -60,6 +66,11 @@ public interface ClusterHandle extends Closeable {
6066
*/
6167
String getHttpAddress(int index);
6268

69+
/**
70+
* Get the name of the node for the given index.
71+
*/
72+
String getName(int index);
73+
6374
/**
6475
* Returns a comma-separated list of TCP transport endpoints for cluster. If this method is called on an unstarted cluster, the cluster
6576
* will be started. This method is thread-safe and subsequent calls will wait for cluster start and availability.

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/DefaultElasticsearchCluster.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public void stop(boolean forcibly) {
5353
handle.stop(forcibly);
5454
}
5555

56+
@Override
57+
public void stopNode(int index) {
58+
checkHandle();
59+
handle.stopNode(index);
60+
}
61+
5662
@Override
5763
public void restart(boolean forcibly) {
5864
checkHandle();
@@ -83,6 +89,12 @@ public String getHttpAddress(int index) {
8389
return handle.getHttpAddress(index);
8490
}
8591

92+
@Override
93+
public String getName(int index) {
94+
checkHandle();
95+
return handle.getName(index);
96+
}
97+
8698
@Override
8799
public String getTransportEndpoints() {
88100
checkHandle();

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterHandle.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ public void upgradeToVersion(Version version) {
156156
waitUntilReady();
157157
}
158158

159+
public String getName(int index) {
160+
return nodes.get(index).getName();
161+
}
162+
163+
public void stopNode(int index) {
164+
nodes.get(index).stop(false);
165+
}
166+
159167
protected void waitUntilReady() {
160168
writeUnicastHostsFile();
161169
try {

x-pack/plugin/core/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
exports org.elasticsearch.xpack.core.logstash;
7373
exports org.elasticsearch.xpack.core.ml.action;
7474
exports org.elasticsearch.xpack.core.ml.annotations;
75+
exports org.elasticsearch.xpack.core.ml.autoscaling;
7576
exports org.elasticsearch.xpack.core.ml.calendars;
7677
exports org.elasticsearch.xpack.core.ml.datafeed.extractor;
7778
exports org.elasticsearch.xpack.core.ml.datafeed;

0 commit comments

Comments
 (0)