Skip to content

Commit

Permalink
Merge branch 'master' into feature/data_stream_support_routing
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 8, 2021
2 parents 1d05523 + 6a2c706 commit 4b3e72c
Show file tree
Hide file tree
Showing 178 changed files with 5,309 additions and 889 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
CHANGELOG.asciidoc merge=union

# These files contain expected text output, and should not be changed on
# Windows
build-tools-internal/src/test/resources/org/elasticsearch/gradle/internal/release/*.asciidoc text eol=lf
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,32 @@ public static void configureCompile(Project project) {
java.setSourceCompatibility(BuildParams.getMinimumRuntimeVersion());
java.setTargetCompatibility(BuildParams.getMinimumRuntimeVersion());

project.afterEvaluate(p -> {
project.getTasks().withType(JavaCompile.class).configureEach(compileTask -> {
CompileOptions compileOptions = compileTask.getOptions();
/*
* -path because gradle will send in paths that don't always exist.
* -missing because we have tons of missing @returns and @param.
* -serial because we don't use java serialization.
*/
// don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :)
// fail on all javac warnings.
// TODO Discuss moving compileOptions.getCompilerArgs() to use provider api with Gradle team.
List<String> compilerArgs = compileOptions.getCompilerArgs();
compilerArgs.add("-Werror");
compilerArgs.add("-Xlint:all,-path,-serial,-options,-deprecation,-try");
compilerArgs.add("-Xdoclint:all");
compilerArgs.add("-Xdoclint:-missing");
// either disable annotation processor completely (default) or allow to enable them if an annotation processor is explicitly
// defined
if (compilerArgs.contains("-processor") == false) {
compilerArgs.add("-proc:none");
}

compileOptions.setEncoding("UTF-8");
compileOptions.setIncremental(true);
// workaround for https://github.com/gradle/gradle/issues/14141
compileTask.getConventionMapping().map("sourceCompatibility", () -> java.getSourceCompatibility().toString());
compileTask.getConventionMapping().map("targetCompatibility", () -> java.getTargetCompatibility().toString());
compileOptions.getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
});
// also apply release flag to groovy, which is used in build-tools
project.getTasks().withType(GroovyCompile.class).configureEach(compileTask -> {
// TODO: this probably shouldn't apply to groovy at all?
compileTask.getOptions().getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
});
project.getTasks().withType(JavaCompile.class).configureEach(compileTask -> {
CompileOptions compileOptions = compileTask.getOptions();
/*
* -path because gradle will send in paths that don't always exist.
* -missing because we have tons of missing @returns and @param.
* -serial because we don't use java serialization.
*/
// don't even think about passing args with -J-xxx, oracle will ask you to submit a bug report :)
// fail on all javac warnings.
// TODO Discuss moving compileOptions.getCompilerArgs() to use provider api with Gradle team.
List<String> compilerArgs = compileOptions.getCompilerArgs();
compilerArgs.add("-Werror");
compilerArgs.add("-Xlint:all,-path,-serial,-options,-deprecation,-try");
compilerArgs.add("-Xdoclint:all");
compilerArgs.add("-Xdoclint:-missing");
compileOptions.setEncoding("UTF-8");
compileOptions.setIncremental(true);
// workaround for https://github.com/gradle/gradle/issues/14141
compileTask.getConventionMapping().map("sourceCompatibility", () -> java.getSourceCompatibility().toString());
compileTask.getConventionMapping().map("targetCompatibility", () -> java.getTargetCompatibility().toString());
compileOptions.getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
});
// also apply release flag to groovy, which is used in build-tools
project.getTasks().withType(GroovyCompile.class).configureEach(compileTask -> {
// TODO: this probably shouldn't apply to groovy at all?
compileTask.getOptions().getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.gradle.internal.release;

import org.junit.Ignore;
import org.junit.Test;

import java.nio.charset.StandardCharsets;
Expand All @@ -17,10 +16,11 @@
import java.util.List;
import java.util.Objects;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;

@Ignore("https://github.com/elastic/elasticsearch/issues/77190")
public class BreakingChangesGeneratorTest {

/**
Expand All @@ -33,6 +33,7 @@ public void generateFile_rendersCorrectMarkup() throws Exception {
final String expectedOutput = getResource(
"/org/elasticsearch/gradle/internal/release/BreakingChangesGeneratorTest.generateFile.asciidoc"
);

final List<ChangelogEntry> entries = getEntries();

// when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.gradle.internal.release;

import org.junit.Ignore;
import org.junit.Test;

import java.nio.charset.StandardCharsets;
Expand All @@ -20,7 +19,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

@Ignore("https://github.com/elastic/elasticsearch/issues/77190")
public class ReleaseHighlightsGeneratorTest {

/**
Expand All @@ -33,6 +31,7 @@ public void generateFile_rendersCorrectMarkup() throws Exception {
final String expectedOutput = getResource(
"/org/elasticsearch/gradle/internal/release/ReleaseHighlightsGeneratorTest.generateFile.asciidoc"
);

final List<ChangelogEntry> entries = getEntries();

// when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.gradle.internal.release;

import org.junit.Ignore;
import org.junit.Test;

import java.nio.charset.StandardCharsets;
Expand All @@ -25,7 +24,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

@Ignore("https://github.com/elastic/elasticsearch/issues/77190")
public class ReleaseNotesGeneratorTest {

/**
Expand All @@ -38,6 +36,7 @@ public void generateFile_rendersCorrectMarkup() throws Exception {
final String expectedOutput = getResource(
"/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.generateFile.asciidoc"
);

final Map<QualifiedVersion, Set<ChangelogEntry>> entries = getEntries();

// when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.gradle.internal.release;

import org.junit.Ignore;
import org.junit.Test;

import java.nio.charset.StandardCharsets;
Expand All @@ -22,7 +21,6 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

@Ignore("https://github.com/elastic/elasticsearch/issues/77190")
public class ReleaseNotesIndexGeneratorTest {

/**
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/77292.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 77292
summary: Enroll additional nodes to cluster
area: "Security"
type: enhancement
issues: []
14 changes: 5 additions & 9 deletions docs/reference/alias.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[chapter]
[[alias]]
[[aliases]]
= Aliases

An alias is a secondary name for a group of data streams or indices. Most {es}
Expand Down Expand Up @@ -208,9 +208,9 @@ GET _alias/logs
[[write-index]]
=== Write index

If an alias points to multiple indices, you can use `is_write_index` to specify
a write index or data stream. {es} routes any write requests for the alias to
this index or data stream.
You can use `is_write_index` to specify a write index or data stream for an
alias. {es} routes any write requests for the alias to this index or data
stream.

[source,console]
----
Expand All @@ -235,11 +235,7 @@ POST _aliases
----
// TEST[s/^/PUT _data_stream\/logs-nginx.access-prod\nPUT _data_stream\/logs-my_app-default\n/]

If an alias points to multiple indices or data streams and `is_write_index`
isn't set, the alias rejects write requests. If an index alias points to one
index and `is_write_index` isn't set, the index automatically acts as the write
index. Data stream aliases don't automatically set a write data stream, even if
the alias points to one data stream.
include::{es-repo-dir}/indices/aliases.asciidoc[tag=write-index-defaults]

TIP: We recommend using data streams to store append-only time series data. If
you frequently update or delete existing time series data, use an index alias
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cat/alias.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>cat aliases</titleabbrev>
++++

Retrieves the cluster's <<alias,index aliases>>, including filter and routing
Retrieves the cluster's <<aliases,index aliases>>, including filter and routing
information. The API does not return data stream aliases.

[[cat-alias-api-request]]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ilm/actions/ilm-rollover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ policy execution waits until the leader index rolls over (or is
then converts the follower index into a regular index with the
<<ilm-unfollow, Unfollow action>>.

A rollover target can be a <<data-streams, data stream>> or an <<alias,index
A rollover target can be a <<data-streams, data stream>> or an <<aliases,index
alias>>. When targeting a data stream, the new index becomes the data stream's
write index and its generation is incremented.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ilm/index-rollover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Each data stream requires an <<index-templates,index template>> that contains:
Data streams are designed for append-only data, where the data stream name
can be used as the operations (read, write, rollover, shrink etc.) target.
If your use case requires data to be updated in place, you can instead manage
your time series data using <<alias,index aliases>>. However, there are a few
your time series data using <<aliases,index aliases>>. However, there are a few
more configuration steps and concepts:

* An _index template_ that specifies the settings for each new index in the series.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/add-alias.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Create or update alias</titleabbrev>
++++

Adds a data stream or index to an <<alias,alias>>.
Adds a data stream or index to an <<aliases,alias>>.

[source,console]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/alias-exists.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Alias exists</titleabbrev>
++++

Checks if an <<alias,alias>> exists.
Checks if an <<aliases,alias>> exists.

[source,console]
----
Expand Down
14 changes: 11 additions & 3 deletions docs/reference/indices/aliases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Aliases</titleabbrev>
++++

Performs one or more <<alias,alias>> actions in a single atomic operation.
Performs one or more <<aliases,alias>> actions in a single atomic operation.

[source,console]
----
Expand Down Expand Up @@ -131,8 +131,16 @@ Only the `add` action supports this parameter.

// tag::alias-options[]
`is_write_index`::
(Optional, Boolean) If `true`, sets the <<write-index,write index or data
stream>> for the alias. Defaults to `false`.
(Optional, Boolean) If `true`, sets the write index or data stream for the
alias.
+
// tag::write-index-defaults[]
If an alias points to multiple indices or data streams and `is_write_index`
isn't set, the alias rejects write requests. If an index alias points to one
index and `is_write_index` isn't set, the index automatically acts as the write
index. Data stream aliases don't automatically set a write data stream, even if
the alias points to one data stream.
// end::write-index-defaults[]
// end::alias-options[]
+
Only the `add` action supports this parameter.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/create-index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ PUT /test
[[create-index-aliases]]
===== Aliases

The create index API allows also to provide a set of <<alias,aliases>>:
The create index API allows also to provide a set of <<aliases,aliases>>:

[source,console]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/delete-alias.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Delete alias</titleabbrev>
++++

Removes a data stream or index from an <<alias,alias>>.
Removes a data stream or index from an <<aliases,alias>>.

[source,console]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/delete-index-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ privilege>> to use this API.

Use the delete index template API to delete one or more index templates.
Index templates define <<index-modules-settings,settings>>, <<mapping,mappings>>,
and <<alias,aliases>> that can be applied automatically to new indices.
and <<aliases,aliases>> that can be applied automatically to new indices.


[[delete-template-api-path-params]]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/delete-index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ or `manage` <<privileges-list-indices,index privilege>> for the target index.
+
--
(Required, string) Comma-separated list of indices to delete. You cannot specify
<<alias,index aliases>>.
<<aliases,index aliases>>.

By default, this parameter does not support wildcards (`*`) or `_all`. To use
wildcards or `_all`, change the `action.destructive_requires_name` setting to
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/get-alias.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Get alias</titleabbrev>
++++

Retrieves information for one or more <<alias,aliases>>.
Retrieves information for one or more <<aliases,aliases>>.

[source,console]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/index-template-exists-v1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Use the index template exists API
to determine whether one or more index templates exist.

Index templates define <<index-modules-settings,settings>>, <<mapping,mappings>>,
and <<alias,aliases>> that can be applied automatically to new indices.
and <<aliases,aliases>> that can be applied automatically to new indices.

[[template-exists-api-path-params]]
==== {api-path-parms-title}
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/migrate-to-data-stream.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<titleabbrev>Migrate to data stream</titleabbrev>
++++

Converts an <<alias,index alias>> to a <<data-streams,data stream>>.
Converts an <<aliases,index alias>> to a <<data-streams,data stream>>.

////
[source,console]
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/indices/put-component-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Creates or updates a component template. Component templates are building blocks
for constructing <<index-templates,index templates>> that specify index
<<mapping,mappings>>, <<index-modules-settings,settings>>, and
<<alias,aliases>>.
<<aliases,aliases>>.

[source,console]
--------------------------------------------------
Expand Down Expand Up @@ -168,7 +168,7 @@ This map is not automatically generated by {es}.

===== Component template with index aliases

You can include <<alias,index aliases>> in a component template.
You can include <<aliases,index aliases>> in a component template.

[source,console]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/put-index-template-v1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ This number is not automatically generated by {es}.

===== Index template with index aliases

You can include <<alias,index aliases>> in an index template.
You can include <<aliases,index aliases>> in an index template.

[source,console]
--------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/indices/put-index-template.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
++++

Creates or updates an index template. Index templates define
<<index-modules-settings,settings>>, <<mapping,mappings>>, and <<alias,aliases>>
<<index-modules-settings,settings>>, <<mapping,mappings>>, and <<aliases,aliases>>
that can be applied automatically to new indices.

[source,console]
Expand Down Expand Up @@ -163,7 +163,7 @@ This number is not automatically generated by {es}.

===== Index template with index aliases

You can include <<alias,index aliases>> in an index template.
You can include <<aliases,index aliases>> in an index template.

[source,console]
--------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/indices/rollover-index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<titleabbrev>Rollover</titleabbrev>
++++

Creates a new index for a <<data-streams,data stream>> or <<alias,index alias>>.
Creates a new index for a <<data-streams,data stream>> or <<aliases,index alias>>.

[source,console]
----
Expand Down
Loading

0 comments on commit 4b3e72c

Please sign in to comment.