Skip to content

Commit 89bc2c6

Browse files
Merge branch 'master' of github.com:elastic/elasticsearch into fix-some-expensive-stuff
2 parents 8a59791 + 7492cc9 commit 89bc2c6

File tree

315 files changed

+4357
-1606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+4357
-1606
lines changed

TESTING.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ the elasticsearch official clients. The YAML based tests describe the
286286
operations to be executed and the obtained results that need to be tested.
287287

288288
The YAML tests support various operators defined in the link:/rest-api-spec/src/main/resources/rest-api-spec/test/README.asciidoc[rest-api-spec] and adhere to the link:/rest-api-spec/README.markdown[Elasticsearch REST API JSON specification]
289-
In order to run the the YAML tests, the relevant API specification needs
289+
In order to run the YAML tests, the relevant API specification needs
290290
to be on the test classpath. Any gradle project that has support for REST
291291
tests will get the primary API on it's class path. However, to better support
292292
Gradle incremental builds, it is recommended to explicitly declare which

buildSrc/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
elasticsearch = 8.0.0
22
lucene = 8.7.0-snapshot-72d8528c3a6
33

4-
bundled_jdk_vendor = openjdk
5-
bundled_jdk = 15+36@779bf45e88a44cbd9ea6621d33e33db1
4+
bundled_jdk_vendor = adoptopenjdk
5+
bundled_jdk = 15.0.1+9
66

77
checkstyle = 8.20
88

client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStream.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public final class DataStream {
3636
private final String timeStampField;
3737
private final List<String> indices;
3838
private final long generation;
39+
private final boolean hidden;
3940
ClusterHealthStatus dataStreamStatus;
4041
@Nullable
4142
String indexTemplate;
@@ -45,7 +46,8 @@ public final class DataStream {
4546
private final Map<String, Object> metadata;
4647

4748
public DataStream(String name, String timeStampField, List<String> indices, long generation, ClusterHealthStatus dataStreamStatus,
48-
@Nullable String indexTemplate, @Nullable String ilmPolicyName, @Nullable Map<String, Object> metadata) {
49+
@Nullable String indexTemplate, @Nullable String ilmPolicyName, @Nullable Map<String, Object> metadata,
50+
boolean hidden) {
4951
this.name = name;
5052
this.timeStampField = timeStampField;
5153
this.indices = indices;
@@ -54,6 +56,7 @@ public DataStream(String name, String timeStampField, List<String> indices, long
5456
this.indexTemplate = indexTemplate;
5557
this.ilmPolicyName = ilmPolicyName;
5658
this.metadata = metadata;
59+
this.hidden = hidden;
5760
}
5861

5962
public String getName() {
@@ -88,6 +91,10 @@ public Map<String, Object> getMetadata() {
8891
return metadata;
8992
}
9093

94+
public boolean isHidden() {
95+
return hidden;
96+
}
97+
9198
public static final ParseField NAME_FIELD = new ParseField("name");
9299
public static final ParseField TIMESTAMP_FIELD_FIELD = new ParseField("timestamp_field");
93100
public static final ParseField INDICES_FIELD = new ParseField("indices");
@@ -96,6 +103,7 @@ public Map<String, Object> getMetadata() {
96103
public static final ParseField INDEX_TEMPLATE_FIELD = new ParseField("template");
97104
public static final ParseField ILM_POLICY_FIELD = new ParseField("ilm_policy");
98105
public static final ParseField METADATA_FIELD = new ParseField("_meta");
106+
public static final ParseField HIDDEN_FIELD = new ParseField("hidden");
99107

100108
@SuppressWarnings("unchecked")
101109
private static final ConstructingObjectParser<DataStream, Void> PARSER = new ConstructingObjectParser<>("data_stream",
@@ -110,7 +118,9 @@ public Map<String, Object> getMetadata() {
110118
String indexTemplate = (String) args[5];
111119
String ilmPolicy = (String) args[6];
112120
Map<String, Object> metadata = (Map<String, Object>) args[7];
113-
return new DataStream(dataStreamName, timeStampField, indices, generation, status, indexTemplate, ilmPolicy, metadata);
121+
Boolean hidden = (Boolean) args[8];
122+
hidden = hidden != null && hidden;
123+
return new DataStream(dataStreamName, timeStampField, indices, generation, status, indexTemplate, ilmPolicy, metadata, hidden);
114124
});
115125

116126
static {
@@ -122,6 +132,7 @@ public Map<String, Object> getMetadata() {
122132
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), INDEX_TEMPLATE_FIELD);
123133
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), ILM_POLICY_FIELD);
124134
PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> p.map(), METADATA_FIELD);
135+
PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), HIDDEN_FIELD);
125136
}
126137

127138
public static DataStream fromXContent(XContentParser parser) throws IOException {

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import org.elasticsearch.Build;
3939
import org.elasticsearch.Version;
4040
import org.elasticsearch.bootstrap.JarHell;
41+
import org.elasticsearch.bootstrap.PluginPolicyInfo;
42+
import org.elasticsearch.bootstrap.PolicyUtil;
4143
import org.elasticsearch.cli.EnvironmentAwareCommand;
4244
import org.elasticsearch.cli.ExitCodes;
4345
import org.elasticsearch.cli.Terminal;
@@ -848,15 +850,11 @@ void jarHellCheck(PluginInfo candidateInfo, Path candidateDir, Path pluginsDir,
848850
private PluginInfo installPlugin(Terminal terminal, boolean isBatch, Path tmpRoot, Environment env, List<Path> deleteOnFailure)
849851
throws Exception {
850852
final PluginInfo info = loadPluginInfo(terminal, tmpRoot, env);
851-
// read optional security policy (extra permissions), if it exists, confirm or warn the user
852-
Path policy = tmpRoot.resolve(PluginInfo.ES_PLUGIN_POLICY);
853-
final Set<String> permissions;
854-
if (Files.exists(policy)) {
855-
permissions = PluginSecurity.parsePermissions(policy, env.tmpFile());
856-
} else {
857-
permissions = Collections.emptySet();
853+
PluginPolicyInfo pluginPolicy = PolicyUtil.getPluginPolicyInfo(tmpRoot);
854+
if (pluginPolicy != null) {
855+
Set<String> permissions = PluginSecurity.getPermissionDescriptions(pluginPolicy, env.tmpFile());
856+
PluginSecurity.confirmPolicyExceptions(terminal, permissions, isBatch);
858857
}
859-
PluginSecurity.confirmPolicyExceptions(terminal, permissions, isBatch);
860858

861859
final Path destination = env.pluginsFile().resolve(info.getName());
862860
deleteOnFailure.add(destination);

docs/java-rest/high-level/getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ more examples of customizing the options.
177177
[[java-rest-high-getting-started-asynchronous-usage]]
178178
=== Asynchronous usage
179179

180-
All of the the methods across the different clients exist in a traditional synchronous and
180+
All of the methods across the different clients exist in a traditional synchronous and
181181
asynchronous variant. The difference is that the asynchronous ones use asynchronous requests
182182
in the REST Low Level Client. This is useful if you are doing multiple requests or are using e.g.
183183
rx java, Kotlin co-routines, or similar frameworks.

0 commit comments

Comments
 (0)